diff options
author | Jacek Antonelli | 2008-12-01 17:39:58 -0600 |
---|---|---|
committer | Jacek Antonelli | 2008-12-01 17:40:06 -0600 |
commit | 7abecb48babe6a6f09bf6692ba55076546cfced9 (patch) | |
tree | 8d18a88513fb97adf32c10aae78f4be1984942db /linden/indra/llvfs/lldir.cpp | |
parent | Second Life viewer sources 1.21.6 (diff) | |
download | meta-impy-7abecb48babe6a6f09bf6692ba55076546cfced9.zip meta-impy-7abecb48babe6a6f09bf6692ba55076546cfced9.tar.gz meta-impy-7abecb48babe6a6f09bf6692ba55076546cfced9.tar.bz2 meta-impy-7abecb48babe6a6f09bf6692ba55076546cfced9.tar.xz |
Second Life viewer sources 1.22.0-RC
Diffstat (limited to 'linden/indra/llvfs/lldir.cpp')
-rw-r--r-- | linden/indra/llvfs/lldir.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/linden/indra/llvfs/lldir.cpp b/linden/indra/llvfs/lldir.cpp index 0e014d9..5bfe11f 100644 --- a/linden/indra/llvfs/lldir.cpp +++ b/linden/indra/llvfs/lldir.cpp | |||
@@ -497,6 +497,29 @@ std::string LLDir::getTempFilename() const | |||
497 | return temp_filename; | 497 | return temp_filename; |
498 | } | 498 | } |
499 | 499 | ||
500 | // static | ||
501 | std::string LLDir::getScrubbedFileName(const std::string uncleanFileName) | ||
502 | { | ||
503 | std::string name(uncleanFileName); | ||
504 | const std::string illegalChars(getForbiddenFileChars()); | ||
505 | // replace any illegal file chars with and underscore '_' | ||
506 | for( unsigned int i = 0; i < illegalChars.length(); i++ ) | ||
507 | { | ||
508 | int j = -1; | ||
509 | while((j = name.find(illegalChars[i])) > -1) | ||
510 | { | ||
511 | name[j] = '_'; | ||
512 | } | ||
513 | } | ||
514 | return name; | ||
515 | } | ||
516 | |||
517 | // static | ||
518 | std::string LLDir::getForbiddenFileChars() | ||
519 | { | ||
520 | return "\\/:*?\"<>|"; | ||
521 | } | ||
522 | |||
500 | void LLDir::setLindenUserDir(const std::string &first, const std::string &last) | 523 | void LLDir::setLindenUserDir(const std::string &first, const std::string &last) |
501 | { | 524 | { |
502 | // if both first and last aren't set, assume we're grabbing the cached dir | 525 | // if both first and last aren't set, assume we're grabbing the cached dir |