Changeset 378 for trunk/src/stl


Ignore:
Timestamp:
05/29/15 12:12:47 (10 years ago)
Author:
epyon
Message:
  • important fix in reverse_iterator operators
  • std::string functions removed or converted to string_ref in string.hh
  • capi.hh - more function forwards and usage of them instead of libc
  • more std removal
  • assert fix
Location:
trunk/src/stl
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/stl/assert.cc

    r376 r378  
    3434}
    3535#       else
    36 #include <assert.h>
     36extern "C" {
     37        extern void __assert_fail(const char *, const char *, unsigned int, const char *)
     38                throw() __attribute__ ((__noreturn__));
     39}
    3740#       endif
    3841void nv_internal_assert( const char * assertion, const char * file, unsigned int line, const char * function )
  • trunk/src/stl/string.cc

    r374 r378  
    1111#include <cstdio>
    1212#include <cstdlib>
     13#include <fstream> // for slurp only
    1314
    1415using namespace nv;
     
    1617static const double s_power_10[] = { 1, 10, 100, 1000, 10000, 100000, 1000000,
    171810000000, 100000000, 1000000000 };
     19
     20std::string nv::slurp( const std::string& filename )
     21{
     22        std::ifstream input( filename );
     23        //              if ( !input.is_open() ) NV_THROW( std::runtime_error, "File "+filename+" not found!");
     24        std::stringstream sstr;
     25        while ( input >> sstr.rdbuf() );
     26        return sstr.str();
     27}
    1828
    1929static inline void string_reverse( char* begin, char* end )
Note: See TracChangeset for help on using the changeset viewer.