Changeset 904


Ignore:
Timestamp:
12/29/19 16:08:36 (5 years ago)
Author:
Maciej Komosinski
Message:

Added a helper function to concatenate path components inserting PATH_SEPARATOR_CHAR

Location:
cpp/frams/util
Files:
2 edited

Legend:

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

    r786 r904  
    291291}
    292292
     293SString concatPath(const SString& in1,const SString& in2)
     294{
     295        SString out=in1;
     296        if (out.len()>0 && out[out.len()-1]!=PATH_SEPARATOR_CHAR)
     297                out+=PATH_SEPARATOR_CHAR;
     298        out+=in2;
     299        return out;
     300}
     301
    293302bool removeCR(SString& s)
    294303{
  • cpp/frams/util/sstringutils.h

    r786 r904  
    2828
    2929SString trim(const SString& s); ///< remove leading/trailing whitespace
     30SString concatPath(const SString& in1,const SString& in2); ///< concatenate path components inserting PATH_SEPARATOR_CHAR if not already present
    3031bool removeCR(SString& s); ///< remove '\r' return true if changed
    3132bool matchWildcard(const SString& word, const SString& pattern);///< '*' in pattern matches any substring
Note: See TracChangeset for help on using the changeset viewer.