} // ecapseman
+// -------------------------------------------------------------------------
+std::string cpPlugins_Interface_CanonicalPath( const std::string& path )
+{
+#ifdef _WIN32
+ TCHAR buffer[ 4096 ] = TEXT( "" );
+ TCHAR** lppPart = { NULL };
+ GetFullPathName( path.c_str( ), 4096, buffer, lppPart );
+ return( std::string( buffer ) );
+#else // Linux like
+ return( std::string( realpath( path.c_str( ), NULL ) ) );
+#endif // _WIN32
+}
+
// -------------------------------------------------------------------------
cpPlugins::Interface::Interface::
Interface( )
PathSeparator sep;
if( sep( folder[ folder.size( ) - 1 ] ) )
real_folder = folder.substr( 0, folder.size( ) - 1 );
-#ifdef _WIN32
- DWORD retval=0;
- BOOL success;
- TCHAR buffer[4096]=TEXT("");
- TCHAR buf[4096]=TEXT("");
- TCHAR** lppPart={NULL};
- // Retrieve the full path name for a file.
- // The file does not need to exist.
- retval = GetFullPathName(folder.c_str( ),
- 4096,
- buffer,
- lppPart);
- real_folder = buffer;
-#else // _WIN32
- real_folder = std::string( realpath( real_folder.c_str( ), NULL ) );
-#endif // _WIN32
+ real_folder = cpPlugins_Interface_CanonicalPath( real_folder );
+
bool ret = true;
try
{
PathSeparator sep;
// Get absolute path
- std::string real_path = "";
-#ifdef _WIN32
- DWORD retval=0;
- BOOL success;
- TCHAR buffer[4096]=TEXT("");
- TCHAR buf[4096]=TEXT("");
- TCHAR** lppPart={NULL};
- // Retrieve the full path name for a file.
- // The file does not need to exist.
- retval = GetFullPathName(path.c_str( ),
- 4096,
- buffer,
- lppPart);
- real_path = buffer;
-#else // _WIN32
- real_path = std::string( realpath( path.c_str( ), NULL ) );
-#endif // _WIN32
+ std::string real_path = cpPlugins_Interface_CanonicalPath( path );
// Get name
name = std::string(