COMMON: Move tag2str from util.h to str.h
svn-id: r48281
This commit is contained in:
parent
3e63df5415
commit
30c84d2cff
4 changed files with 39 additions and 24 deletions
|
@ -59,6 +59,10 @@ String StringTokenizer::nextToken() {
|
|||
return String(_str.c_str() + _tokenBegin, _tokenEnd - _tokenBegin);
|
||||
}
|
||||
|
||||
|
||||
#pragma mark -
|
||||
|
||||
|
||||
//
|
||||
// Print hexdump of the data passed in
|
||||
//
|
||||
|
@ -111,21 +115,6 @@ void hexdump(const byte * data, int len, int bytesPerLine, int startOffset) {
|
|||
printf("|\n");
|
||||
}
|
||||
|
||||
String tag2string(uint32 tag) {
|
||||
char str[5];
|
||||
str[0] = (char)(tag >> 24);
|
||||
str[1] = (char)(tag >> 16);
|
||||
str[2] = (char)(tag >> 8);
|
||||
str[3] = (char)tag;
|
||||
str[4] = '\0';
|
||||
// Replace non-printable chars by dot
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
if (!isprint((unsigned char)str[i]))
|
||||
str[i] = '.';
|
||||
}
|
||||
return Common::String(str);
|
||||
}
|
||||
|
||||
|
||||
#pragma mark -
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue