- virtual const char* GetClassName( ) override { return( #N ); } \
- virtual const char* GetClassCategory( ) override { return( #C ); }
-
-/*
- * =========================================================================
- * Some functions
- * =========================================================================
- */
-#include <iostream>
-namespace cpPlugins
-{
- struct PathHelper
- {
- // ---------------------------------------------------------------------
- inline bool operator()( char c ) const
- {
-#ifdef cpPlugins_SYS_WINDOWS
- return( c == '\\' || c == '/' );
-#else // cpPlugins_SYS_WINDOWS
- return( c == '/' );
-#endif // cpPlugins_SYS_WINDOWS
- }
-
- // ---------------------------------------------------------------------
- inline static std::string CanonicalPath( const std::string& path )
- {
- std::string ret = "";
-#ifdef cpPlugins_SYS_WINDOWS
- TCHAR buffer[ 4096 ] = TEXT( "" );
- TCHAR** lppPart = { NULL };
- GetFullPathName( path.c_str( ), 4096, buffer, lppPart );
- ret = std::string( buffer );
-#else // cpPlugins_SYS_WINDOWS
- char* canonical_path = realpath( path.c_str( ), NULL );
- if( canonical_path != NULL )
- {
- ret = canonical_path;
- free( canonical_path );
-
- } // fi
-#endif // cpPlugins_SYS_WINDOWS
- return( ret );
- }
- };
-
-} // ecapseman