Changeset 256 for trunk/src/library.cc


Ignore:
Timestamp:
06/14/14 21:06:00 (11 years ago)
Author:
epyon
Message:
  • various minor fixes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/library.cc

    r166 r256  
    44#include "nv/common.hh"
    55#include "nv/library.hh"
    6 
    7 #include <string.h>
    86
    97#if NV_PLATFORM == NV_WINDOWS
     
    4139}
    4240
    43 void library::open( const std::string& name )
     41void library::open( const string& name )
    4442{
    4543        m_name = name;
     
    5149}
    5250
    53 bool nv::library::try_open( const std::string& name )
     51bool nv::library::try_open( const string& name )
    5452{
    5553        m_name = name;
     
    6260}
    6361
    64 const std::string& library::get_name() const
     62const string& library::get_name() const
    6563{
    6664    return m_name;
     
    7573    NV_LOG( LOG_NOTICE, "library : loading '" + m_name + "'..." );
    7674
    77     std::string name = m_name;
    78     std::string ext  = NV_LIB_EXT;
     75    string name = m_name;
     76    string ext  = NV_LIB_EXT;
    7977    size_t ext_len   = ext.length();
    8078
     
    9593}
    9694
    97 void* library::get( const std::string& symbol )
     95void* library::get( const string& symbol )
    9896{
    9997        void* result = (void*) NV_LIB_GET( (NV_LIB_HANDLE) m_handle, symbol.c_str() );
     
    105103}
    106104
    107 void* nv::library::try_get( const std::string& symbol )
     105void* nv::library::try_get( const string& symbol )
    108106{
    109107        return (void*) NV_LIB_GET( (NV_LIB_HANDLE) m_handle, symbol.c_str() );
     
    133131}
    134132
    135 std::string library::get_error()
     133string library::get_error()
    136134{
    137135#if NV_PLATFORM == NV_WINDOWS
     
    140138    FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
    141139        NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &buffer, 0, NULL );
    142     std::string msg( (char*)buffer );
     140    string msg( (char*)buffer );
    143141    LocalFree( buffer );
    144142    return msg;
    145143#elif NV_PLATFORM == NV_LINUX || NV_PLATFORM == NV_APPLE
    146     return std::string(dlerror());
     144    return string(dlerror());
    147145#else
    148     return std::string("");
     146    return string("");
    149147#endif
    150148}
Note: See TracChangeset for help on using the changeset viewer.