mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2024-11-10 00:52:11 +01:00
Added 2 new path slash related helper methods to string.
This commit is contained in:
parent
3fa13484c0
commit
6d6735717b
@ -1043,6 +1043,17 @@ void String::append_path(const String &path) {
|
||||
}
|
||||
}
|
||||
|
||||
void String::path_clean_end_slash() {
|
||||
while (ends_with('/') || ends_with('\\')) {
|
||||
pop_back();
|
||||
}
|
||||
}
|
||||
void String::path_ensure_end_slash() {
|
||||
if (!(ends_with('/') || ends_with('\\'))) {
|
||||
push_back(DEFAULT_DIRECTORY_SEPARATOR);
|
||||
}
|
||||
}
|
||||
|
||||
void String::to_html_special_chars() {
|
||||
replace("&", "&");
|
||||
replace("\"", """);
|
||||
|
@ -109,6 +109,8 @@ public:
|
||||
|
||||
void append_path(const char* path);
|
||||
void append_path(const String &path);
|
||||
void path_clean_end_slash();
|
||||
void path_ensure_end_slash();
|
||||
|
||||
void to_html_special_chars();
|
||||
void from_html_special_chars();
|
||||
|
Loading…
Reference in New Issue
Block a user