Changeset b1eefe50
- Timestamp:
- Jan 19, 2024, 4:36:18 PM (11 months ago)
- Branches:
- master
- Children:
- dd10bf4
- Parents:
- ac939461
- Location:
- libcfa/src/collections
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/collections/string.cfa
rac939461 rb1eefe50 91 91 // Assignment 92 92 93 void ?=?( string & s, const char * val ) { 94 (*s.inner) = val; 95 } 96 97 // with and without const on "other" argument helps keep prevent autogen ?=? calls 98 void ?=?(string & s, const string & c) { 93 string & ?=?(string & s, const string & c) { 99 94 (*s.inner) = (*c.inner); 100 } 95 return s; 96 } 97 101 98 string & ?=?(string & s, string & c) { 102 99 (*s.inner) = (*c.inner); … … 104 101 } 105 102 106 void ?=?( string & s, charval ) {103 string & ?=?( string & s, const char * val ) { 107 104 (*s.inner) = val; 108 } 109 110 void assign(string & s, const string & c, size_t n) { 105 return s; 106 } 107 108 string & ?=?( string & s, char val ) { 109 (*s.inner) = val; 110 return s; 111 } 112 113 string & assign(string & s, const string & c, size_t n) { 111 114 assign(*s.inner, *c.inner, n); 112 } 113 void assign(string & s, const char * c, size_t n) { 115 return s; 116 } 117 118 string & assign(string & s, const char * c, size_t n) { 114 119 assign(*s.inner, c, n); 120 return s; 115 121 } 116 122 -
libcfa/src/collections/string.hfa
rac939461 rb1eefe50 41 41 void ?{}(string & s, const char * c, size_t size); // copy specific length from buffer 42 42 43 void ?=?(string & s, const char * c); // copy assignment from literal 44 void ?=?(string & s, const string & c); 45 void ?=?(string & s, char c); 46 string & ?=?(string & s, string & c); // surprising ret seems to help avoid calls to autogen 47 void assign(string & s, const string & c, size_t n); 48 void assign(string & s, const char * c, size_t n); 49 //string ?=?( string &, string ) = void; 43 string & ?=?(string & s, const string & c); 44 string & ?=?(string & s, string & c); 45 string & ?=?(string & s, const char * c); // copy from "literal" 46 string & ?=?(string & s, char c); // copy from 'l' 47 string & assign(string & s, const string & c, size_t n); 48 string & assign(string & s, const char * c, size_t n); 50 49 51 50 static inline string & strcpy(string & s, const char * c) { s = c; return s; }
Note: See TracChangeset
for help on using the changeset viewer.