#include <cstdlib>
#include <fstream>
#include <sstream>
+#include <Pluma/Pluma.hpp>
#ifdef _WIN32
# define PLUGIN_PREFIX ""
cpPlugins::Interface::Interface::
Interface( )
{
- this->m_Pluma.acceptProviderType< ProcessObjectProvider >( );
+ this->m_Pluma = new pluma::Pluma( );
+ this->m_Pluma->acceptProviderType< ProcessObjectProvider >( );
}
// -------------------------------------------------------------------------
~Interface( )
{
this->UnloadAll( );
+ delete this->m_Pluma;
}
// -------------------------------------------------------------------------
bool ret = true;
try
{
- ret = this->m_Pluma.load( path );
+ ret = this->m_Pluma->load( path );
if( ret )
{
std::string folder, name;
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
bool ret = true;
try
{
- ret = this->m_Pluma.load( real_folder, name );
+ ret = this->m_Pluma->load( real_folder, name );
if( ret )
{
// Update loaded plugins
{
try
{
- std::list< std::string > f = this->m_Pluma.loadFromFolder( folder, r );
+ std::list< std::string > f = this->m_Pluma->loadFromFolder( folder, r );
if( f.size( ) > 0 )
{
// Update loaded plugins
bool ret = true;
try
{
- ret = this->m_Pluma.unload( name );
+ ret = this->m_Pluma->unload( name );
if( ret )
{
this->m_Providers.clear( );
{
try
{
- this->m_Pluma.unloadAll( );
+ this->m_Pluma->unloadAll( );
}
catch( ... )
{
bool cpPlugins::Interface::Interface::
IsLoaded( const std::string& name ) const
{
- return( this->m_Pluma.isLoaded( name ) );
+ return( this->m_Pluma->isLoaded( name ) );
}
// -------------------------------------------------------------------------
{
this->m_Providers.clear( );
this->m_Classes.clear( );
- this->m_Pluma.getProviders( this->m_Providers );
+ this->m_Pluma->getProviders( this->m_Providers );
// Get reader provider
for( unsigned int i = 0; i < this->m_Providers.size( ); ++i )
PathSeparator sep;
// Get absolute path
- std::string real_path = std::string( realpath( path.c_str( ), NULL ) );
+ 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
// Get name
name = std::string(