# Path: importerUtils.py
# def getUInt16(data, offset):
# 	'''
# 	Returns a single unsingned 16-Bit value.
# 	Args:
# 		data
# 			A binary string.
# 		offset
# 			The zero based offset of the unsigned 16-Bit value.
# 	Returns:
# 		The unsigned 16-Bit value at offset.
# 		The new position in the 'stream'.
# 	'''
# 	val, = UINT16(data, offset)
# 	return val, offset + 2
# 
# def getUInt32(data, offset):
# 	'''
# 	Returns a single unsingned 32-Bit value.
# 	Args:
# 		data
# 			A binary string.
# 		offset
# 			The zero based offset of the unsigned 32-Bit value.
# 	Returns:
# 		The unsigned 32-Bit value at offset.
# 		The new position in the 'stream'.
# 	'''
# 	val, = UINT32(data, offset)
# 	return val, offset + 4
# 
# def getLen32Text8(data, offset):
# 	l, i = getUInt32(data, offset)
# 	try:
# 		txt, i = getText8(data, i, l)
# 	except UnicodeDecodeError:
# 		txt = data[i:i+l]
# 		i += l
# 	return txt, i
# 
# def getLen32Text16(data, offset):
# 	l, i = getUInt32(data, offset)
# 	end = i + 2 * l
# 	txt = data[i: end].decode('UTF-16LE')
# 	if (txt[-1:] == '\0'):
# 		txt = txt[:-1]
# 
# 	if (txt[-1:] == '\n'):
# 		txt = txt[:-1]
# 	return txt, end


from importerUtils import getUInt16, getUInt32, getLen32Text8, getLen32Text16

# -*- coding: utf-8 -*-


def getText(data, offset):
	e = data.index(b'\x00', offset)
	return data[offset:e], e + 1

class olenative(object):
	def __init__(self):
		self.size        = 0
		self.header      = None
		self.label       = u''

# Path: importerUtils.py
# def getUInt16(data, offset):
# 	'''
# 	Returns a single unsingned 16-Bit value.
# 	Args:
# 		data
# 			A binary string.
# 		offset
# 			The zero based offset of the unsigned 16-Bit value.
# 	Returns:
# 		The unsigned 16-Bit value at offset.
# 		The new position in the 'stream'.
# 	'''
# 	val, = UINT16(data, offset)
# 	return val, offset + 2
# 
# def getUInt32(data, offset):
# 	'''
# 	Returns a single unsingned 32-Bit value.
# 	Args:
# 		data
# 			A binary string.
# 		offset
# 			The zero based offset of the unsigned 32-Bit value.
# 	Returns:
# 		The unsigned 32-Bit value at offset.
# 		The new position in the 'stream'.
# 	'''
# 	val, = UINT32(data, offset)
# 	return val, offset + 4
# 
# def getLen32Text8(data, offset):
# 	l, i = getUInt32(data, offset)
# 	try:
# 		txt, i = getText8(data, i, l)
# 	except UnicodeDecodeError:
# 		txt = data[i:i+l]
# 		i += l
# 	return txt, i
# 
# def getLen32Text16(data, offset):
# 	l, i = getUInt32(data, offset)
# 	end = i + 2 * l
# 	txt = data[i: end].decode('UTF-16LE')
# 	if (txt[-1:] == '\0'):
# 		txt = txt[:-1]
# 
# 	if (txt[-1:] == '\n'):
# 		txt = txt[:-1]
# 	return txt, end


# Path: importerOle10Nateive.py
from importerUtils import getUInt16, getUInt32, getLen32Text8, getLen32Text16

# -*- coding: utf-8 -*-


def getText(data, offset):
	e = data.index(b'\x00', offset)
	return data[offset:e], e + 1

class olenative(object):
	def __init__(self):
		self.size        = 0
		self.header      = None
		self.label       = u''

		self.orgPath     = u''
