Changeset 438 for trunk/src/core


Ignore:
Timestamp:
07/23/15 17:29:49 (10 years ago)
Author:
epyon
Message:
  • massive amount of std::string removal
  • removed slurp, use filesystem::slurp instead
  • lua_values const_string support
  • several bugfixes
  • program_manager and shader loading without std::string/std::stream
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/core/library.cc

    r437 r438  
    66
    77#include "nv/core/library.hh"
    8 #include <string>
    98
    109#if NV_PLATFORM == NV_WINDOWS
     
    7473    NV_LOG_NOTICE( "library \"", m_name, "\" : loading..." );
    7574
    76         std::string name( m_name.data(), m_name.length() );
    77         std::string ext( NV_LIB_EXT );
     75        string128 name( m_name );
     76        string_view ext( NV_LIB_EXT );
    7877
    79         if ( name.length() < ext.length() || name.substr( name.length() - ext.length(), ext.length() ) != ext )
     78        if ( name.length() < ext.length() || !name.ends_with( ext ) )
    8079    {
    81         name.append( ext.data(), ext.length() );
     80        name.append( ext );
    8281    }
    8382
    84     m_handle = NV_LIB_OPEN( name.c_str() );
     83    m_handle = NV_LIB_OPEN( name.data() );
    8584
    8685    if ( m_handle == NULL )
    8786    {
    88                 NV_LOG_NOTICE( "library \"", m_name, "\" : failed to open!" );
     87                NV_LOG_NOTICE( "library \"", name, "\" : failed to open!" );
    8988                return false;
    9089    }
Note: See TracChangeset for help on using the changeset viewer.