Changeset 529


Ignore:
Timestamp:
07/18/16 04:15:22 (4 years ago)
Author:
Maciej Komosinski
Message:

\r can be optionally removed while loading

Location:
cpp/frams/util
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/util/sstringutils.cpp

    r523 r529  
    88#include <common/nonstd.h>
    99
    10 int loadSString(const char* filename, SString& s, const char* framsgmodule, const char* error)
     10int loadSString(const char* filename, SString& s, const char* framsgmodule, const char* error, bool remove_cr)
    1111{
    1212        VirtFILE *f;
     
    1414        if (f = Vfopen(filename, FOPEN_READ_BINARY))
    1515        {
    16                 loadSString(f, s);
     16                loadSString(f, s, remove_cr);
    1717                ret = 1;
    1818                delete f;
     
    2323}
    2424
    25 void loadSString(VirtFILE *f, SString& s)
     25void loadSString(VirtFILE *f, SString& s, bool remove_cr)
    2626{
    2727        char buf[1024];
     
    3232                s.append(buf, len);
    3333        }
    34         removeCR(s);
     34        if (remove_cr)
     35                removeCR(s);
    3536}
    3637
  • cpp/frams/util/sstringutils.h

    r512 r529  
    1010
    1111/// return: 1=ok 0=error
    12 int loadSString(const char* filename, SString& s, const char* framsgmodule = 0, const char* error = 0);
    13 void loadSString(VirtFILE *f, SString& s);
     12int loadSString(const char* filename, SString& s, const char* framsgmodule = 0, const char* error = 0, bool remove_cr=true);
     13void loadSString(VirtFILE *f, SString& s, bool remove_cr=true);
    1414bool loadSStringLine(VirtFILE* f, SString &s);
    1515
Note: See TracChangeset for help on using the changeset viewer.