ENV_GetSize

Syntax

#include <nitro/env.h>
int ENV_GetSize( const char* name );
  

Arguments

name Pointer to the resource name. If this string begins with "." (period), the class name is considered to be omitted, and the current class is filled in before that period.

Return Values

Gets the size of the resource.

Description

Gets the size of the designated resource.

Be aware that end marks in the string are also counted for the resource size of the string defined with ENV_STRING. For the resource size of the string defined with ENV_BINARY, end marks in the 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 // End mark
};

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.

See Also

ENV_Init
ENV_Get*
ENV_GetType
ENV_SetClass

Revision History

2005/08/16 Initial version.


CONFIDENTIAL