Skip to content

Group GCUtilities_h

Modules > GCUtilities_h

Public Functions

Type Name
SPINNAKER_API bool DoesEnvironmentVariableExist (const Spinnaker::GenICam::gcstring & VariableName)
SPINNAKER_API void GetFiles (const gcstring & FileTemplate, gcstring_vector & FileNames, const bool DirectoriesOnly=false)
SPINNAKER_API gcstring GetGenICamCLProtocolFolder (void)
SPINNAKER_API gcstring GetGenICamCacheFolder (void)
SPINNAKER_API gcstring GetGenICamLogConfig (void)
SPINNAKER_API gcstring GetModulePathFromFunction (void * pFunction)
SPINNAKER_API gcstring GetValueOfEnvironmentVariable (const gcstring & VariableName)
SPINNAKER_API bool GetValueOfEnvironmentVariable (const gcstring & VariableName, gcstring & VariableContent)
T INTEGRAL_CAST (int64_t ll)
Td INTEGRAL_CAST2 (Ts s)
SPINNAKER_API void ReplaceEnvironmentVariables (gcstring & Buffer, bool ReplaceBlankBy20=false)
SPINNAKER_API void SetGenICamCLProtocolFolder (const gcstring & path)
SPINNAKER_API void SetGenICamCacheFolder (const gcstring & path)
SPINNAKER_API void SetGenICamLogConfig (const gcstring & path)
SPINNAKER_API void Tokenize (const gcstring & str, gcstring_vector & tokens, const gcstring & delimiters=" ")
SPINNAKER_API gcstring UrlDecode (const gcstring & Input)
SPINNAKER_API gcstring UrlEncode (const gcstring & Input)

Public Functions Documentation

function DoesEnvironmentVariableExist

SPINNAKER_API bool DoesEnvironmentVariableExist (
    const Spinnaker::GenICam::gcstring & VariableName
) 

Returns true if an environment variable exists


function GetFiles

SPINNAKER_API void GetFiles (
    const gcstring & FileTemplate,
    gcstring_vector & FileNames,
    const bool DirectoriesOnly=false
) 

Gets a list of files or directories matching a given FileTemplate


function GetGenICamCLProtocolFolder

SPINNAKER_API gcstring GetGenICamCLProtocolFolder (
    void
) 

Retrieve the path of the CLProtocol folder The path to the CLProtocol folder can be stored by calling SetGenICamCLProtocolFolder(). If GetGenICamCLProtocolFolder() is called before SetGenICamCLProtocolFolder(), it will return the value of environment variable GENICAM_CLPROTOCOL. If this environment variable does not exist, an exception will be thrown.


function GetGenICamCacheFolder

SPINNAKER_API gcstring GetGenICamCacheFolder (
    void
) 

Retrieve the path of the GenICam cache folder The path to the cache folder can be stored by calling SetGenICamCacheFolder(). If GetGenICamCacheFolder() is called before SetGenICamCacheFolder(), it will return the value of environment variable GENICAM_CACHE_Vx_y. If this environment variable does not exist, an exception will be thrown.


function GetGenICamLogConfig

SPINNAKER_API gcstring GetGenICamLogConfig (
    void
) 

Retrieve the path of the GenICam logging properties file

The path to the logging properties file can be stored by calling SetGenICamLogConfig(). If GetGenICamLogConfig() is called before SetGenICamLogConfig(), it will return the value of environment variable GENICAM_LOG_CONFIG_Vx_y. If this environment variable does not exist, an exception will be thrown.


function GetModulePathFromFunction

SPINNAKER_API gcstring GetModulePathFromFunction (
    void * pFunction
) 

true = only subdirectories (ex . and ..) are retrieved; false = only files are retrieved Gets the full path to the module (DLL/SO) containing the given pFunction; empty string if not found.


function GetValueOfEnvironmentVariable

SPINNAKER_API gcstring GetValueOfEnvironmentVariable (
    const gcstring & VariableName
) 

Retrieve the value of an environment variable

Exception:

  • runtime_exception if not found

function GetValueOfEnvironmentVariable

SPINNAKER_API bool GetValueOfEnvironmentVariable (
    const gcstring & VariableName,
    gcstring & VariableContent
) 

Retrieve the value of an environment variable

Returns:

true if environment variable was found, otherwise false


function INTEGRAL_CAST

template<typename T>
inline T INTEGRAL_CAST (
    int64_t ll
) 

This verifies at runtime if there was no loss of data if an int64_t was downcast to type T (e.g. int32_t)


function INTEGRAL_CAST2

template<typename Td, typename Ts>
inline Td INTEGRAL_CAST2 (
    Ts s
) 

This verifies at runtime if there was no loss of data if an type Ts (e.g. int64t) was downcast to type Td (e.g. int32_t)


function ReplaceEnvironmentVariables

SPINNAKER_API void ReplaceEnvironmentVariables (
    gcstring & Buffer,
    bool ReplaceBlankBy20=false
) 

Replaces in a string and replace ' ' with %20


function SetGenICamCLProtocolFolder

SPINNAKER_API void SetGenICamCLProtocolFolder (
    const gcstring & path
) 

Stores the path of the CLProtocol folder


function SetGenICamCacheFolder

SPINNAKER_API void SetGenICamCacheFolder (
    const gcstring & path
) 

Stores the path of the GenICam cache folder


function SetGenICamLogConfig

SPINNAKER_API void SetGenICamLogConfig (
    const gcstring & path
) 

Stores the path of the GenICam logging properties file


function Tokenize

SPINNAKER_API void Tokenize (
    const gcstring & str,
    gcstring_vector & tokens,
    const gcstring & delimiters=" "
) 

splits str input string into a list of tokens using the delimiter


function UrlDecode

SPINNAKER_API gcstring UrlDecode (
    const gcstring & Input
) 

Replaces xx escapes by their char equivalent


function UrlEncode

SPINNAKER_API gcstring UrlEncode (
    const gcstring & Input
) 

Converts \ to / and replaces all unsave characters by their xx equivalent