Ignore:
Timestamp:
06/25/20 00:34:29 (4 years ago)
Author:
Maciej Komosinski
Message:

Genetic format ID becomes a string (no longer limited to a single character)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/util/sstring-simple.h

    r793 r955  
    2727        SString(); ///< make an empty string
    2828        SString(const char*t, int t_len = -1); ///< make a string from char*
    29         SString(int x); ///< string with initial buffer allocated for x characters
     29        SString(int x) = delete; ///< disallow the former 'int' constructor (so the new 'char' version is not used through implicit conversion)
    3030        SString(const SString& from); ///< duplicate string
    3131        SString(SString&& from);///< move
     32        SString(char in);
    3233        ~SString();
    3334
    3435        void copyFrom(const char* ch, int chlen = -1); ///< copy string, length of -1 == unknown
    35 
     36       
    3637        void* operator new(size_t s, void* mem){ return mem; }
    3738#ifdef _MSC_VER
     
    4344        int len() const { return used; } ///< get string length
    4445        void shrink(); ///< free unnecessary buffer
     46        void reserve(int needed) { ensureSize(needed); } ///< like in std::string
    4547
    4648        /// after this call, you can modify sstring directly.
Note: See TracChangeset for help on using the changeset viewer.