From aecaf271f1fe98cba1ebc8228ff9eff3e39e72c5 Mon Sep 17 00:00:00 2001 From: hrydgard Date: Sun, 21 Jun 2009 08:39:21 +0000 Subject: 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 --- Source/Core/Common/Src/StringUtil.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'Source/Core/Common/Src/StringUtil.cpp') 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 -- cgit v1.2.3