diff options
author | Mark Palange <palange@lindenlab.com> | 2008-11-07 17:51:03 +0000 |
---|---|---|
committer | Mark Palange <palange@lindenlab.com> | 2008-11-07 17:51:03 +0000 |
commit | f89f19990cbb9f3f2e7473ac6c159098bdfabec7 (patch) | |
tree | e7fa406e2db5e9adc2e24e00557d7b3d3f93203a /indra/llvfs/lldir.cpp | |
parent | b2bfb128e7d30e1cdb293a2ac192a0cbe63fe528 (diff) |
QAR-992 Merging revisions 101012-101170,101686-101687 of svn+ssh://svn.lindenlab.com/svn/linden/qa/viewer_combo_1-22-merge into linden/release
Diffstat (limited to 'indra/llvfs/lldir.cpp')
-rw-r--r-- | indra/llvfs/lldir.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/indra/llvfs/lldir.cpp b/indra/llvfs/lldir.cpp index ff7bfde521..8acf7d88ca 100644 --- a/indra/llvfs/lldir.cpp +++ b/indra/llvfs/lldir.cpp @@ -497,6 +497,29 @@ std::string LLDir::getTempFilename() const return temp_filename; } +// static +std::string LLDir::getScrubbedFileName(const std::string uncleanFileName) +{ + std::string name(uncleanFileName); + const std::string illegalChars(getForbiddenFileChars()); + // replace any illegal file chars with and underscore '_' + for( unsigned int i = 0; i < illegalChars.length(); i++ ) + { + int j = -1; + while((j = name.find(illegalChars[i])) > -1) + { + name[j] = '_'; + } + } + return name; +} + +// static +std::string LLDir::getForbiddenFileChars() +{ + return "\\/:*?\"<>|"; +} + void LLDir::setLindenUserDir(const std::string &first, const std::string &last) { // if both first and last aren't set, assume we're grabbing the cached dir |