29 #ifndef GENAPI_GENAPIUTILITIES_DEF_H_ 30 #define GENAPI_GENAPIUTILITIES_DEF_H_ 36 #include <GenICamVersion.h> 42 #include <Base/GCLinkage.h> 44 #if defined(UNDER_RTSS) 46 #endif // defined(UNDER_RTSS) 48 #if defined(UNDER_RTSS) 49 #define USE_TEMP_CACHE_FILE 0 51 #define USE_TEMP_CACHE_FILE 1 52 #endif // defined(UNDER_RTSS) 54 #if defined(UNDER_RTSS) 55 #define USE_TEMP_CACHE_FILE 0 57 #define USE_TEMP_CACHE_FILE 1 58 #endif // defined(UNDER_RTSS) 60 #if defined (_MSC_VER) 62 # define PLATFORM_NAME "Win64_x64" 64 # define PLATFORM_NAME "Win32_i86" 66 #elif defined (__GNUC__) 67 # define GENICAM_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) 68 # if defined (__linux__) 69 # if defined(__x86_64) || defined(__x86_64__) || defined(__amd64) 70 # define PLATFORM_NAME "Linux64_x64" 71 # elif defined(__i386) || defined(__i386__) 72 # define PLATFORM_NAME "Linux32_i86" 73 # elif defined(__arm__) || defined(__TARGET_ARCH_ARM) 74 # define PLATFORM_NAME "Linux32_ARMhf" 75 # elif defined(__AARCH64EL__) || defined(__AARCH64_CMODEL_SMALL__) 76 # define PLATFORM_NAME "Linux64_ARM" 78 # elif defined (__APPLE__) 79 # if defined (__LP64__) 80 # define PLATFORM_NAME "Maci64_x64" 82 # error Unsupported Platform 85 # error Unknown Platform 88 # error Unknown Platform 92 # define GC_COUNTOF(arr) (sizeof (arr) / sizeof (arr)[0] ) 99 template<
typename Td,
typename Ts>
102 const Td d =
static_cast<Td
>( s );
103 if ( static_cast<Ts>( d ) != s ){
114 return INTEGRAL_CAST2<T, int64_t>( ll );
127 GCBASE_API
void GetCandidateCacheFilePaths(gcstring_vector &CacheFileNames,
const gcstring &CacheFileDirectory);
130 GCBASE_API
void GetLastErrorMessage(
gcstring &Message);
141 GCBASE_API
bool GetValueOfEnvironmentVariable(
const gcstring &VariableName,
gcstring &VariableContent );
143 #if defined(UNDER_RTSS) 144 GCBASE_API
bool DoesFileExist(
const gcstring &FilePath );
146 #endif // defined(UNDER_RTSS) 197 gcstring_vector& tokens,
204 gcstring_vector &FileNames,
205 const bool DirectoriesOnly =
false );
211 #define GENICAM_UNUSED(unused_var) ((void)(unused_var)) 213 #if !defined(GENICAM_DEPRECATED) 214 # if defined(__GNUC__) && (((__GNUC__ * 100) + __GNUC_MINOR__ ) >= 301) // is at least GCC 3.1 compiler? 215 # define GENICAM_DEPRECATED(FUNCTION) FUNCTION __attribute__ ((deprecated)) 216 # elif defined(_MSC_VER) && (_MSC_VER >= 1300) // is at least VC 2003 compiler? 217 # define GENICAM_DEPRECATED(FUNCTION) __declspec(deprecated) FUNCTION 219 # define GENICAM_DEPRECATED(FUNCTION) FUNCTION 220 # endif // compiler check 221 #endif // #if !defined(GENICAM_DEPRECATED) 233 #define _TO_STRING( __stN ) #__stN 234 #define EXPAND_TO_STRINGISE( __stN ) _TO_STRING( __stN ) 235 #define __LINE_STR__ EXPAND_TO_STRINGISE(__LINE__) 236 #define __LOCATION__ __FILE__ "(" __LINE_STR__ ")" 237 #define __OUTPUT_FORMATER__(_type) __LOCATION__ " : " _type " : " 240 #define __WARN__ __OUTPUT_FORMATER__("WARNING") 241 #define __ERR__ __OUTPUT_FORMATER__("ERROR") 242 #define __TODO__ __OUTPUT_FORMATER__("TBD") 244 #endif // GENAPI_GENAPIUTILITIES_DEF_H_ Td INTEGRAL_CAST2(Ts s)
Definition: GCUtilities.h:100
GCBASE_API GENICAM_NAMESPACE::gcstring UrlDecode(const GENICAM_NAMESPACE::gcstring &Input)
GCBASE_API void GetFiles(const gcstring &FileTemplate, gcstring_vector &FileNames, const bool DirectoriesOnly=false)
Gets a list of files or directories matching a given FileTemplate.
Portable string vector implementation.
GCBASE_API gcstring GetModulePathFromFunction(void *pFunction)
true = only subdirectories (ex . and ..) are retrieved; false = only files are retrieved ...
GCBASE_API bool HasValidLength(const gcstring &FileName)
Returns the truth value for the proposition: The given file name has the valid length.
GCBASE_API bool HasValidExtension(const gcstring &FileName)
Returns the truth value for the proposition: The given file has the valid file extension.
GCBASE_API gcstring GetGenICamLogConfig(void)
Retrieve the path of the GenICam logging properties file.
#define RUNTIME_EXCEPTION
Fires a runtime exception, e.g. throw RUNTIME_EXCEPTION("buh!")
Definition: GCException.h:246
GCBASE_API gcstring UrlEncode(const GENICAM_NAMESPACE::gcstring &Input)
GCBASE_API gcstring GetGenICamCacheFolder(void)
Retrieve the path of the GenICam cache folder.
GCBASE_API void SetGenICamLogConfig(const gcstring &path)
Stores the path of the GenICam logging properties file.
GCBASE_API void Tokenize(const gcstring &str, gcstring_vector &tokens, const gcstring &delimiters=" ")
splits str input string into a list of tokens using the delimiter
GCBASE_API gcstring GetGenICamCLProtocolFolder(void)
Retrieve the path of the CLProtocol folder.
Standard GenICam Exceptions.
GCBASE_API void ReplaceEnvironmentVariables(gcstring &Buffer, bool ReplaceBlankBy20=false)
A string class which is a clone of std::string.
Definition: GCString.h:50
T INTEGRAL_CAST(int64_t ll)
Definition: GCUtilities.h:112
Portable string implementation.
GCBASE_API void SetGenICamCLProtocolFolder(const gcstring &path)
Stores the path of the CLProtocol folder.
GCBASE_API bool GetCacheFileDirectory(gcstring &CacheFileDirectory)
Returns the directory where cache files are located.
GCBASE_API void SetGenICamCacheFolder(const gcstring &path)
Stores the path of the GenICam cache folder.
GCBASE_API bool DoesEnvironmentVariableExist(const gcstring &VariableName)
Returns true if an environment variable exists.
Platform-dependent type definitions.
GCBASE_API gcstring GetValueOfEnvironmentVariable(const gcstring &VariableName)