mtg editor import

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@118 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2006-12-18 23:06:43 +00:00
parent 3048befc2e
commit 9ddc690d68
7 changed files with 264 additions and 4 deletions
+1 -1
View File
@@ -49,7 +49,7 @@ class Defaultable {
/// Is this value in the default state?
inline bool isDefault() const { return is_default; }
/// Set the defaultness to true
inline void setDefault() { is_default = true; }
inline void makeDefault() { is_default = true; }
/// Set the defaultness to false
inline void unsetDefault() { is_default = false; }
+6
View File
@@ -66,6 +66,12 @@ String substr_replace(const String& input, size_t start, size_t end, const Strin
return input.substr(0,start) + replacement + input.substr(end);
}
String replace_all(const String& heystack, const String& needle, const String& replacement) {
String ret = heystack;
ret.Replace(needle, replacement);
return ret;
}
// ----------------------------------------------------------------------------- : Words
String last_word(const String& s) {
+3
View File
@@ -84,6 +84,9 @@ String trim_left(const String&);
/// Replace the substring [start...end) of 'input' with 'replacement'
String substr_replace(const String& input, size_t start, size_t end, const String& replacement);
/// Replace all occurences of one needle with replacement
String replace_all(const String& heystack, const String& needle, const String& replacement);
// ----------------------------------------------------------------------------- : Words
/// Returns the last word in a string