#include <nitro/env.h>
int ENV_GetSize( const char* name );
name |
The pointer to the resource name. If this character string begins with a ". " (a period), the class name is considered to be omitted and the current class is filled in before that period. |
Gets the size of the resource.
Gets the size of the designated resource.
Be aware that end marks in the character string are also counted for the resource size of the character string defined with ENV_STRING()
. For the resource size of the character string defined with ENV_BINARY()
, end marks in the character string are not counted. For example:
ENVResource myResource[] = {
"class.s1", ENV_STRING( "abcdef" ),
"class.b1", ENV_BINARY( "abcdef" ),
"class.s2", ENV_STRING( "\0\0\0" ),
"class.b2", ENV_BINARY( "\0\0\0" ),
"class,val1", ENV_U32( 10000 ),
ENV_RESOURCE_END
};
For resource groups such as the one above,
ENV_GetSize( "class.s1" )
has a size of 7.ENV_GetSize( "class.b1" )
has a size of 6.
For reference, sizeof( "abcdef" )
has a size of 7. strlen( "abcdef" )
has a size of 6.
ENV_GetSize( "class.s1" )
has a size of 4.ENV_GetSize( "class.b2" )
has a size of 3.
For reference, sizeof( "\0\0\0" )
has a size of 4. strlen( "\0\0\0" )
has a size of 0.
ENV_GetSize( "class.val1" )
has a size of 4.
ENV_Init, ENV_Get*, ENV_GetType, ENV_SetClass
08/16/2005 Initial version.