Changeset 4e8df745 for libcfa/src/containers/string_res.hfa
- Timestamp:
- Oct 26, 2021, 4:27:10 PM (2 years ago)
- Branches:
- ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
- Children:
- 1733184
- Parents:
- 2b30370
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/containers/string_res.hfa
r2b30370 r4e8df745 17 17 18 18 #include <fstream.hfa> 19 #include <string.h> // e.g. strlen 19 20 20 21 … … 72 73 // Constructors, Assignment Operators, Destructor 73 74 void ?{}(string_res &s); // empty string 74 void ?{}(string_res &s, const char* initial); // copy from string literal (NULL-terminated)75 75 void ?{}(string_res &s, const char* buffer, size_t bsize); // copy specific length from buffer 76 static inline void ?{}(string_res &s, const char* rhs) { // copy from string literal (NULL-terminated) 77 (s){ rhs, strlen(rhs) }; 78 } 76 79 77 80 void ?{}(string_res &s, const string_res & s2) = void; … … 85 88 86 89 void assign(string_res &s, const char* buffer, size_t bsize); // copy specific length from buffer 87 void ?=?(string_res &s, const char* other); // copy from string literal (NULL-terminated) 90 static inline void ?=?(string_res &s, const char* other) { // copy from string literal (NULL-terminated) 91 assign(s, other, strlen(other)); 92 } 88 93 void ?=?(string_res &s, const string_res &other); 89 94 void ?=?(string_res &s, string_res &other); … … 97 102 98 103 // Concatenation 104 void append(string_res &s, const char* buffer, size_t bsize); 99 105 void ?+=?(string_res &s, char other); // append a character 100 106 void ?+=?(string_res &s, const string_res &s2); // append-concatenate to first string 101 void ?+=?(string_res &s, const char* other); 102 void append(string_res &s, const char* buffer, size_t bsize); 107 static inline void ?+=?(string_res &s, const char* other) { 108 append( s, other, strlen(other) ); 109 } 103 110 104 111 // Character access
Note: See TracChangeset
for help on using the changeset viewer.