Browse CVS Repository
Diff of /xoonips/AL/common.cc
Parent Directory
| Revision Log
| Revision Graph
| Patch
| 3 |
* |
* |
| 4 |
* $Revision$ |
* $Revision$ |
| 5 |
* $Log$ |
* $Log$ |
| 6 |
|
* Revision 1.3 2004/11/26 05:13:40 aga |
| 7 |
|
* ・userid_t, groupid_tをunsigned int に修正. |
| 8 |
|
* ・unsignedIntToString()を作成. |
| 9 |
|
* |
| 10 |
* Revision 1.2 2004/11/26 03:29:43 aga |
* Revision 1.2 2004/11/26 03:29:43 aga |
| 11 |
* ・intToString()を作成. |
* ・intToString()を作成. |
| 12 |
* |
* |
| 82 |
string s( buf ); |
string s( buf ); |
| 83 |
return s; |
return s; |
| 84 |
} |
} |
| 85 |
|
|
| 86 |
|
/** |
| 87 |
|
* |
| 88 |
|
* unsigned intを文字列に変換。 |
| 89 |
|
* |
| 90 |
|
* @param i 変換すべき数値 |
| 91 |
|
* @return 変換後の文字列 |
| 92 |
|
* |
| 93 |
|
*/ |
| 94 |
|
string unsignedIntToString( unsigned int i ){ |
| 95 |
|
char buf[sizeof(int)*3+1+1]; // nバイトなら3n+1桁以下、\0で1桁 |
| 96 |
|
snprintf( buf, sizeof(buf), "%u", i ); |
| 97 |
|
string s( buf ); |
| 98 |
|
return s; |
| 99 |
|
} |
| 100 |
|
|
| 101 |
|
|
| 102 |
|
|
|
|
Legend:
| Removed from v.1.2 |
|
| changed lines |
| |
Added in v.1.3 |
|
|
|