Example #1
0
long int AssetFileSystem_ftell( AssetFileSystem_FILE * stream )
{
	off_t total = AAsset_getLength( stream );
	off_t remain = AAsset_getRemainingLength( stream );
	off_t offset = total - remain;
	return (offset >= 0 && offset <= total) ? offset : -1L;
}
	int AndroidResourceStream::read(void* dest, unsigned int length)
	{
		if (mRemaining <= 0)
			return 0;

		int r = AAsset_read(mAsset, dest, length);
		mRemaining = AAsset_getRemainingLength(mAsset);
		return r;
	}
Example #3
0
Int64 ResourceStream::tell()
{
    if (m_file)
    {
        return getSize() - AAsset_getRemainingLength(m_file);
    }
    else
    {
        return -1;
    }
}
Example #4
0
static orxS64 orxFASTCALL orxResource_APK_Tell(orxHANDLE _hResource)
{
  AAsset   *poAsset;
  orxS64    s64Result;

  /* Gets asset */
  poAsset = (AAsset *)_hResource;

  /* Updates result */
  s64Result = (orxS64)AAsset_getLength(poAsset) - (orxS64)AAsset_getRemainingLength(poAsset);

  /* Done! */
  return s64Result;
}
static long       file_tell_android_asset(FILEHANDLE handle)
{
	off_t length;
	off_t remainingLength;
	long retval;

	length = AAsset_getLength((AAsset *) handle);
	remainingLength = AAsset_getRemainingLength((AAsset *) handle);

	retval = length - remainingLength;

	/*
	__android_log_print(ANDROID_LOG_VERBOSE, "org.libsdl.app", "AssetFile: tell len=%d remainingLen=%d tell=%ld",
			length, remainingLength, retval);
	*/

	return retval;
}
Example #6
0
//--------------------------------------------------------------------------
VeSizeT VeAssetIStream::RemainingLength() const noexcept
{
	return AAsset_getRemainingLength(m_pkAsset);
}
Example #7
0
//--------------------------------------------------------------------------
VeSizeT VeAssetIStream::Tell() noexcept
{
	return AAsset_getLength(m_pkAsset) - AAsset_getRemainingLength(m_pkAsset);
}
Example #8
0
long int FileStreamAndroid::position()
{
    return AAsset_getLength(_asset) - AAsset_getRemainingLength(_asset);
}
Example #9
0
int AssetFileSystem_feof( AssetFileSystem_FILE * stream )
{
	int n = AAsset_getRemainingLength( stream );
	return (0 == n) ? 1 : 0;
}
Example #10
0
 int GetPosition() const
 {
     return (int)(AAsset_getLength(asset) - AAsset_getRemainingLength(asset));
 }
Example #11
0
size_t ApkFile::position()
{
	return (size_t) (AAsset_getLength(_asset) - AAsset_getRemainingLength(_asset));
}
Example #12
0
bool ApkFile::end_of_file()
{
	return AAsset_getRemainingLength(_asset) == 0;
}
long CAndroidAssetReader::getPos() const
{
  return AAsset_getLength(Asset) - AAsset_getRemainingLength(Asset);
}