stringy strings
This commit is contained in:
@ -136,7 +136,21 @@ public:
|
||||
double strtonum() const;
|
||||
|
||||
//updated convenience functions as class members
|
||||
//todo
|
||||
amsarray<amsstring> splitlines() const;
|
||||
amsarray<amsstring> split(const ams_chartype delimitchar) const;
|
||||
amsarray<amsstring> split(const ams_chartype *delimitstr) const;
|
||||
amsarray<amsstring> splitfirst(const ams_chartype delimitchar) const; //guaranteed size 2 array
|
||||
amsarray<amsstring> splitfirst(const ams_chartype *delimitstr) const; //guaranteed size 2 array
|
||||
amsarray<amsstring> splitwhitespace() const;
|
||||
amsstring stripwhitespace() const;
|
||||
amsstring stripallwhitespace() const;
|
||||
amsstring stripnewlines() const;
|
||||
amsarray<amsstring> splitalphanum() const;
|
||||
amsarray<amsstring> path_splitext() const;
|
||||
amsarray<amsstring> path_split() const;
|
||||
amsstring select_between(const ams_chartype *delimitleft, const ams_chartype *delimitright) const;
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
@ -180,6 +194,12 @@ amsarray<amsstring> splitwhitespace(const amsstring &s);
|
||||
amsstring stripwhitespace(const amsstring &s);
|
||||
amsstring stripallwhitespace(const amsstring &s);
|
||||
|
||||
//strips \r and \n from the right side of the string
|
||||
amsstring stripnewlines(const amsstring &s);
|
||||
|
||||
//strips \r and \n from the right side of the strings
|
||||
void stripnewlines(amsarray<amsstring> *sa_inout);
|
||||
|
||||
//splits a string into contiguous sets of alphanumeric characters ignoring non-alphanums
|
||||
amsarray<amsstring> splitalphanum(const amsstring &s);
|
||||
|
||||
@ -204,8 +224,6 @@ amsstring concatenate(const amsarray<amsstring> &slist);
|
||||
//adds \n between each line in the concatenated string
|
||||
amsstring concat_lines(const amsarray<amsstring> &lns);
|
||||
|
||||
|
||||
|
||||
void freadline(FILE *fp, amsstring *s);
|
||||
void freadlines(FILE *fp, amsarray<amsstring> *lines);
|
||||
void fwritelines(FILE *fp, amsstring *s);
|
||||
|
||||
Reference in New Issue
Block a user