1 // TortoiseSVN - a Windows shell extension for easy version control
3 // Copyright (C) 2003-2006 - Stefan Kueng
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software Foundation,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
29 void CUtils::StringExtend(LPTSTR str
)
34 cPos
= _tcschr(cPos
, '\\');
37 memmove(cPos
+1, cPos
, _tcslen(cPos
)*sizeof(TCHAR
));
43 } while (cPos
!= NULL
);
47 cPos
= _tcschr(cPos
, '\n');
50 memmove(cPos
+1, cPos
, _tcslen(cPos
)*sizeof(TCHAR
));
54 } while (cPos
!= NULL
);
58 cPos
= _tcschr(cPos
, '\r');
61 memmove(cPos
+1, cPos
, _tcslen(cPos
)*sizeof(TCHAR
));
65 } while (cPos
!= NULL
);
69 cPos
= _tcschr(cPos
, '\t');
72 memmove(cPos
+1, cPos
, _tcslen(cPos
)*sizeof(TCHAR
));
76 } while (cPos
!= NULL
);
80 cPos
= _tcschr(cPos
, '"');
83 memmove(cPos
+1, cPos
, _tcslen(cPos
)*sizeof(TCHAR
));
89 } while (cPos
!= NULL
);
92 void CUtils::StringCollapse(LPTSTR str
)
97 cPos
= _tcschr(cPos
, '\\');
100 if (*(cPos
+1) == 'n')
103 memmove(cPos
+1, cPos
+2, (_tcslen(cPos
+2)+1)*sizeof(TCHAR
));
105 else if (*(cPos
+1) == 'r')
108 memmove(cPos
+1, cPos
+2, (_tcslen(cPos
+2)+1)*sizeof(TCHAR
));
110 else if (*(cPos
+1) == 't')
113 memmove(cPos
+1, cPos
+2, (_tcslen(cPos
+2)+1)*sizeof(TCHAR
));
115 else if (*(cPos
+1) == '"')
118 memmove(cPos
+1, cPos
+2, (_tcslen(cPos
+2)+1)*sizeof(TCHAR
));
120 else if (*(cPos
+1) == '\\')
123 memmove(cPos
+1, cPos
+2, (_tcslen(cPos
+2)+1)*sizeof(TCHAR
));
127 } while (cPos
!= NULL
);
134 FORMAT_MESSAGE_ALLOCATE_BUFFER
|
135 FORMAT_MESSAGE_FROM_SYSTEM
|
136 FORMAT_MESSAGE_IGNORE_INSERTS
,
139 MAKELANGID(LANG_NEUTRAL
, SUBLANG_DEFAULT
), // Default language
147 // Display the string.
148 _ftprintf(stderr
, _T("%s\n"), (LPCTSTR
)lpMsgBuf
);
151 LocalFree( lpMsgBuf
);