Experimenting with tabs
This commit is contained in:
@@ -108,3 +108,45 @@ bool Seek(String16 string, String16 find, int64_t *index_out = NULL, SeekFlag fl
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
String16 ChopLastSlash(String16 s) {
|
||||
String16 result = s;
|
||||
Seek(s, L"/", &result.len, SeekFlag_MatchFindLast);
|
||||
return result;
|
||||
}
|
||||
|
||||
String16 ChopLastPeriod(String16 s) {
|
||||
String16 result = s;
|
||||
Seek(s, L".", &result.len, SeekFlag_MatchFindLast);
|
||||
return result;
|
||||
}
|
||||
|
||||
String16 SkipToLastSlash(String16 s) {
|
||||
int64_t pos;
|
||||
String16 result = s;
|
||||
if (Seek(s, L"/", &pos, SeekFlag_MatchFindLast)) {
|
||||
result = Skip(result, pos + 1);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
String16 SkipToLastPeriod(String16 s) {
|
||||
int64_t pos;
|
||||
String16 result = s;
|
||||
if (Seek(s, L".", &pos, SeekFlag_MatchFindLast)) {
|
||||
result = Skip(result, pos + 1);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
String16 CutPrefix(String16 *string, int64_t len) {
|
||||
String16 result = GetPrefix(*string, len);
|
||||
*string = Skip(*string, len);
|
||||
return result;
|
||||
}
|
||||
|
||||
String16 CutPostfix(String16 *string, int64_t len) {
|
||||
String16 result = GetPostfix(*string, len);
|
||||
*string = Chop(*string, len);
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user