summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Src/StringUtil.cpp
diff options
context:
space:
mode:
authorhrydgard <hrydgard@gmail.com>2009-06-21 08:39:21 +0000
committerhrydgard <hrydgard@gmail.com>2009-06-21 08:39:21 +0000
commitaecaf271f1fe98cba1ebc8228ff9eff3e39e72c5 (patch)
tree4c82001793b35149ae81fcb483f13b22d3b6fa11 /Source/Core/Common/Src/StringUtil.cpp
parent80217a6ed718d15c75784090340cd3ddd9432f96 (diff)
New DSP debugger: step one. (not ready yet, but try loading zelda WW and look at the dsp debugger..).
Had to shuffle around quite a lot of code to be able to extract the CodeView into a library nicely so it can be used from both the main dolphin and the LLE plugin... also extracted the symboldb code. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3517 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/Common/Src/StringUtil.cpp')
-rw-r--r--Source/Core/Common/Src/StringUtil.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/Source/Core/Common/Src/StringUtil.cpp b/Source/Core/Common/Src/StringUtil.cpp
index 0233c5e841..b7cb1adb1c 100644
--- a/Source/Core/Common/Src/StringUtil.cpp
+++ b/Source/Core/Common/Src/StringUtil.cpp
@@ -460,3 +460,32 @@ void NormalizeDirSep(std::string* str)
}
#endif
}
+
+std::string TabsToSpaces(int tab_size, const std::string &in)
+{
+ std::string out;
+ int len = 0;
+ // First, compute the size of the new string.
+ for (int i = 0; i < in.size(); i++)
+ {
+ if (in[i] == '\t')
+ len += tab_size;
+ else
+ len += 1;
+ }
+ out.resize(len);
+ int out_ctr = 0;
+ for (int i = 0; i < in.size(); i++)
+ {
+ if (in[i] == '\t')
+ {
+ for (int j = 0; j < tab_size; j++)
+ out[out_ctr++] = ' ';
+ }
+ else
+ {
+ out[out_ctr++] = in[i];
+ }
+ }
+ return out;
+} \ No newline at end of file