diff options
author | Jacek Antonelli | 2009-11-19 04:19:06 -0600 |
---|---|---|
committer | Jacek Antonelli | 2009-11-19 04:19:06 -0600 |
commit | 1d443b7a94ed6f9ef1d408caef72fcbc0b1ee427 (patch) | |
tree | e09ccbc010e326a48fd91ba15b58afd7fb836b3f /linden/indra/llcommon/llstring.h | |
parent | Fixed minor formatting issue in MANIFESTO.txt. (diff) | |
parent | Fixed CMake setting errors (diff) | |
download | meta-impy-1d443b7a94ed6f9ef1d408caef72fcbc0b1ee427.zip meta-impy-1d443b7a94ed6f9ef1d408caef72fcbc0b1ee427.tar.gz meta-impy-1d443b7a94ed6f9ef1d408caef72fcbc0b1ee427.tar.bz2 meta-impy-1d443b7a94ed6f9ef1d408caef72fcbc0b1ee427.tar.xz |
Merge remote branch 'mccabe/1.3.0-next' into next
Conflicts:
linden/indra/cmake/00-Common.cmake
linden/indra/newview/skins/default/xui/de/floater_about.xml
linden/indra/newview/skins/default/xui/fr/floater_about.xml
linden/indra/newview/skins/default/xui/ja/floater_about.xml
linden/indra/newview/skins/default/xui/ko/floater_about.xml
linden/indra/newview/skins/default/xui/zh/floater_about.xml
linden/install.xml
Diffstat (limited to 'linden/indra/llcommon/llstring.h')
-rw-r--r-- | linden/indra/llcommon/llstring.h | 55 |
1 files changed, 31 insertions, 24 deletions
diff --git a/linden/indra/llcommon/llstring.h b/linden/indra/llcommon/llstring.h index 93bd89a..7db62bc 100644 --- a/linden/indra/llcommon/llstring.h +++ b/linden/indra/llcommon/llstring.h | |||
@@ -17,7 +17,8 @@ | |||
17 | * There are special exceptions to the terms and conditions of the GPL as | 17 | * There are special exceptions to the terms and conditions of the GPL as |
18 | * it is applied to this Source Code. View the full text of the exception | 18 | * it is applied to this Source Code. View the full text of the exception |
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | 19 | * in the file doc/FLOSS-exception.txt in this software distribution, or |
20 | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception | 20 | * online at |
21 | * http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
21 | * | 22 | * |
22 | * By copying, modifying or distributing this software, you acknowledge | 23 | * By copying, modifying or distributing this software, you acknowledge |
23 | * that you have read and understood your obligations described above, | 24 | * that you have read and understood your obligations described above, |
@@ -32,16 +33,28 @@ | |||
32 | #ifndef LL_LLSTRING_H | 33 | #ifndef LL_LLSTRING_H |
33 | #define LL_LLSTRING_H | 34 | #define LL_LLSTRING_H |
34 | 35 | ||
36 | #include <string> | ||
37 | |||
35 | #if LL_LINUX || LL_SOLARIS | 38 | #if LL_LINUX || LL_SOLARIS |
36 | #include <wctype.h> | 39 | #include <wctype.h> |
37 | #include <wchar.h> | 40 | #include <wchar.h> |
38 | #endif | 41 | #endif |
39 | #include "linden_common.h" | 42 | #include "linden_common.h" |
40 | 43 | ||
44 | #include <string.h> | ||
45 | |||
46 | #if LL_SOLARIS | ||
47 | // stricmp and strnicmp do not exist on Solaris: | ||
48 | #define stricmp strcasecmp | ||
49 | #define strnicmp strncasecmp | ||
50 | #endif | ||
51 | |||
41 | const char LL_UNKNOWN_CHAR = '?'; | 52 | const char LL_UNKNOWN_CHAR = '?'; |
42 | 53 | ||
43 | #if LL_DARWIN || LL_LINUX || LL_SOLARIS | 54 | #if LL_DARWIN || LL_LINUX || LL_SOLARIS |
44 | // Template specialization of char_traits for U16s. Only necessary on Mac and Linux (exists on Windows already) | 55 | // Template specialization of char_traits for U16s. Only necessary on Mac and Linux (exists on Windows already) |
56 | #include <cstring> | ||
57 | |||
45 | namespace std | 58 | namespace std |
46 | { | 59 | { |
47 | template<> | 60 | template<> |
@@ -487,48 +500,29 @@ namespace LLStringFn | |||
487 | /** | 500 | /** |
488 | * @brief Replace all non-printable characters with replacement in | 501 | * @brief Replace all non-printable characters with replacement in |
489 | * string. | 502 | * string. |
503 | * NOTE - this will zap non-ascii | ||
490 | * | 504 | * |
491 | * @param [in,out] string the to modify. out value is the string | 505 | * @param [in,out] string the to modify. out value is the string |
492 | * with zero non-printable characters. | 506 | * with zero non-printable characters. |
493 | * @param The replacement character. use LL_UNKNOWN_CHAR if unsure. | 507 | * @param The replacement character. use LL_UNKNOWN_CHAR if unsure. |
494 | */ | 508 | */ |
495 | void replace_nonprintable( | 509 | void replace_nonprintable_in_ascii( |
496 | std::basic_string<char>& string, | 510 | std::basic_string<char>& string, |
497 | char replacement); | 511 | char replacement); |
498 | 512 | ||
499 | /** | ||
500 | * @brief Replace all non-printable characters with replacement in | ||
501 | * a wide string. | ||
502 | * | ||
503 | * @param [in,out] string the to modify. out value is the string | ||
504 | * with zero non-printable characters. | ||
505 | * @param The replacement character. use LL_UNKNOWN_CHAR if unsure. | ||
506 | */ | ||
507 | void replace_nonprintable( | ||
508 | std::basic_string<llwchar>& string, | ||
509 | llwchar replacement); | ||
510 | 513 | ||
511 | /** | 514 | /** |
512 | * @brief Replace all non-printable characters and pipe characters | 515 | * @brief Replace all non-printable characters and pipe characters |
513 | * with replacement in a string. | 516 | * with replacement in a string. |
517 | * NOTE - this will zap non-ascii | ||
514 | * | 518 | * |
515 | * @param [in,out] the string to modify. out value is the string | 519 | * @param [in,out] the string to modify. out value is the string |
516 | * with zero non-printable characters and zero pipe characters. | 520 | * with zero non-printable characters and zero pipe characters. |
517 | * @param The replacement character. use LL_UNKNOWN_CHAR if unsure. | 521 | * @param The replacement character. use LL_UNKNOWN_CHAR if unsure. |
518 | */ | 522 | */ |
519 | void replace_nonprintable_and_pipe(std::basic_string<char>& str, | 523 | void replace_nonprintable_and_pipe_in_ascii(std::basic_string<char>& str, |
520 | char replacement); | 524 | char replacement); |
521 | 525 | ||
522 | /** | ||
523 | * @brief Replace all non-printable characters and pipe characters | ||
524 | * with replacement in a wide string. | ||
525 | * | ||
526 | * @param [in,out] the string to modify. out value is the string | ||
527 | * with zero non-printable characters and zero pipe characters. | ||
528 | * @param The replacement wide character. use LL_UNKNOWN_CHAR if unsure. | ||
529 | */ | ||
530 | void replace_nonprintable_and_pipe(std::basic_string<llwchar>& str, | ||
531 | llwchar replacement); | ||
532 | 526 | ||
533 | /** | 527 | /** |
534 | * @brief Remove all characters that are not allowed in XML 1.0. | 528 | * @brief Remove all characters that are not allowed in XML 1.0. |
@@ -536,6 +530,19 @@ namespace LLStringFn | |||
536 | * Works with US ASCII and UTF-8 encoded strings. JC | 530 | * Works with US ASCII and UTF-8 encoded strings. JC |
537 | */ | 531 | */ |
538 | std::string strip_invalid_xml(const std::string& input); | 532 | std::string strip_invalid_xml(const std::string& input); |
533 | |||
534 | |||
535 | /** | ||
536 | * @brief Replace all control characters (0 <= c < 0x20) with replacement in | ||
537 | * string. This is safe for utf-8 | ||
538 | * | ||
539 | * @param [in,out] string the to modify. out value is the string | ||
540 | * with zero non-printable characters. | ||
541 | * @param The replacement character. use LL_UNKNOWN_CHAR if unsure. | ||
542 | */ | ||
543 | void replace_ascii_controlchars( | ||
544 | std::basic_string<char>& string, | ||
545 | char replacement); | ||
539 | } | 546 | } |
540 | 547 | ||
541 | //////////////////////////////////////////////////////////// | 548 | //////////////////////////////////////////////////////////// |