Changeset 256 for trunk/src/library.cc
- Timestamp:
- 06/14/14 21:06:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/library.cc
r166 r256 4 4 #include "nv/common.hh" 5 5 #include "nv/library.hh" 6 7 #include <string.h>8 6 9 7 #if NV_PLATFORM == NV_WINDOWS … … 41 39 } 42 40 43 void library::open( const st d::string& name )41 void library::open( const string& name ) 44 42 { 45 43 m_name = name; … … 51 49 } 52 50 53 bool nv::library::try_open( const st d::string& name )51 bool nv::library::try_open( const string& name ) 54 52 { 55 53 m_name = name; … … 62 60 } 63 61 64 const st d::string& library::get_name() const62 const string& library::get_name() const 65 63 { 66 64 return m_name; … … 75 73 NV_LOG( LOG_NOTICE, "library : loading '" + m_name + "'..." ); 76 74 77 st d::string name = m_name;78 st d::string ext = NV_LIB_EXT;75 string name = m_name; 76 string ext = NV_LIB_EXT; 79 77 size_t ext_len = ext.length(); 80 78 … … 95 93 } 96 94 97 void* library::get( const st d::string& symbol )95 void* library::get( const string& symbol ) 98 96 { 99 97 void* result = (void*) NV_LIB_GET( (NV_LIB_HANDLE) m_handle, symbol.c_str() ); … … 105 103 } 106 104 107 void* nv::library::try_get( const st d::string& symbol )105 void* nv::library::try_get( const string& symbol ) 108 106 { 109 107 return (void*) NV_LIB_GET( (NV_LIB_HANDLE) m_handle, symbol.c_str() ); … … 133 131 } 134 132 135 st d::string library::get_error()133 string library::get_error() 136 134 { 137 135 #if NV_PLATFORM == NV_WINDOWS … … 140 138 FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, 141 139 NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &buffer, 0, NULL ); 142 st d::string msg( (char*)buffer );140 string msg( (char*)buffer ); 143 141 LocalFree( buffer ); 144 142 return msg; 145 143 #elif NV_PLATFORM == NV_LINUX || NV_PLATFORM == NV_APPLE 146 return st d::string(dlerror());144 return string(dlerror()); 147 145 #else 148 return st d::string("");146 return string(""); 149 147 #endif 150 148 }
Note: See TracChangeset
for help on using the changeset viewer.