diff options
author | Jacek Antonelli | 2008-08-15 23:45:19 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:19 -0500 |
commit | b235c59d60472f818a9142c0886b95a0ff4191d7 (patch) | |
tree | d323c55587584b19cc43a03f58a178823f12d3cd /linden/indra/llcommon/llstring.h | |
parent | Second Life viewer sources 1.18.5.3 (diff) | |
download | meta-impy-b235c59d60472f818a9142c0886b95a0ff4191d7.zip meta-impy-b235c59d60472f818a9142c0886b95a0ff4191d7.tar.gz meta-impy-b235c59d60472f818a9142c0886b95a0ff4191d7.tar.bz2 meta-impy-b235c59d60472f818a9142c0886b95a0ff4191d7.tar.xz |
Second Life viewer sources 1.18.6.0-RC
Diffstat (limited to 'linden/indra/llcommon/llstring.h')
-rw-r--r-- | linden/indra/llcommon/llstring.h | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/linden/indra/llcommon/llstring.h b/linden/indra/llcommon/llstring.h index 70f7d54..ae44ac3 100644 --- a/linden/indra/llcommon/llstring.h +++ b/linden/indra/llcommon/llstring.h | |||
@@ -481,7 +481,37 @@ std::ostream& operator<<(std::ostream &s, const LLStringBase<T> &str) | |||
481 | std::ostream& operator<<(std::ostream &s, const LLWString &wstr); | 481 | std::ostream& operator<<(std::ostream &s, const LLWString &wstr); |
482 | 482 | ||
483 | #if LL_WINDOWS | 483 | #if LL_WINDOWS |
484 | int safe_snprintf(char *str, size_t size, const char *format, ...); | 484 | /* @name Windows string helpers |
485 | */ | ||
486 | //@{ | ||
487 | |||
488 | /** | ||
489 | * @brief Implementation the expected snprintf interface. | ||
490 | * | ||
491 | * If the size of the passed in buffer is not large enough to hold the string, | ||
492 | * two bad things happen: | ||
493 | * 1. resulting formatted string is NOT null terminated | ||
494 | * 2. Depending on the platform, the return value could be a) the required | ||
495 | * size of the buffer to copy the entire formatted string or b) -1. | ||
496 | * On Windows with VS.Net 2003, it returns -1 e.g. | ||
497 | * | ||
498 | * safe_snprintf always adds a NULL terminator so that the caller does not | ||
499 | * need to check for return value or need to add the NULL terminator. | ||
500 | * It does not, however change the return value - to let the caller know | ||
501 | * that the passed in buffer size was not large enough to hold the | ||
502 | * formatted string. | ||
503 | * | ||
504 | */ | ||
505 | int safe_snprintf(char* str, size_t size, const char* format, ...); | ||
506 | |||
507 | /** | ||
508 | * @brief Convert a wide string to std::string | ||
509 | * | ||
510 | * This replaces the unsafe W2A macro from ATL. | ||
511 | */ | ||
512 | std::string ll_convert_wide_to_string(const wchar_t* in); | ||
513 | |||
514 | //@} | ||
485 | #endif // LL_WINDOWS | 515 | #endif // LL_WINDOWS |
486 | 516 | ||
487 | /** | 517 | /** |