diff options
author | Oz Linden <oz@lindenlab.com> | 2015-02-27 09:03:04 -0500 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2015-02-27 09:03:04 -0500 |
commit | 83851db09ab0fecbb6722826055a55844fd98ea6 (patch) | |
tree | b3c73b1dec463e4d8a8a315f1d713a83e119d99b /indra/llappearance | |
parent | bdb42b4c716a374ab7a7b54a630ed5b5a481cdb2 (diff) | |
parent | d4a2e9fd9a0e7001a6c824ddd6cf37039a632b9d (diff) |
merge up to 3.7.25-release
Diffstat (limited to 'indra/llappearance')
-rwxr-xr-x | indra/llappearance/llwearable.cpp | 13 | ||||
-rwxr-xr-x | indra/llappearance/llwearable.h | 4 |
2 files changed, 9 insertions, 8 deletions
diff --git a/indra/llappearance/llwearable.cpp b/indra/llappearance/llwearable.cpp index 4bce3f99ed..41c06f4368 100755 --- a/indra/llappearance/llwearable.cpp +++ b/indra/llappearance/llwearable.cpp @@ -86,10 +86,10 @@ LLAssetType::EType LLWearable::getAssetType() const return LLWearableType::getAssetType(mType); } -BOOL LLWearable::exportFile(LLFILE* fp) const +BOOL LLWearable::exportFile(const std::string& filename) const { - llofstream ofs(fp); - return exportStream(ofs); + llofstream ofs(filename, std::ios_base::out | std::ios_base::trunc | std::ios_base::binary); + return ofs.is_open() && exportStream(ofs); } // virtual @@ -201,10 +201,11 @@ void LLWearable::createLayers(S32 te, LLAvatarAppearance *avatarp) } } -LLWearable::EImportResult LLWearable::importFile(LLFILE* fp, LLAvatarAppearance* avatarp ) +LLWearable::EImportResult LLWearable::importFile(const std::string& filename, + LLAvatarAppearance* avatarp ) { - llifstream ifs(fp); - return importStream(ifs, avatarp); + llifstream ifs(filename, std::ios_base::in | std::ios_base::binary); + return (! ifs.is_open())? FAILURE : importStream(ifs, avatarp); } // virtual diff --git a/indra/llappearance/llwearable.h b/indra/llappearance/llwearable.h index 630eb1e3a5..875c2932f1 100755 --- a/indra/llappearance/llwearable.h +++ b/indra/llappearance/llwearable.h @@ -81,8 +81,8 @@ public: SUCCESS, BAD_HEADER }; - BOOL exportFile(LLFILE* file) const; - EImportResult importFile(LLFILE* file, LLAvatarAppearance* avatarp ); + BOOL exportFile(const std::string& filename) const; + EImportResult importFile(const std::string& filename, LLAvatarAppearance* avatarp ); virtual BOOL exportStream( std::ostream& output_stream ) const; virtual EImportResult importStream( std::istream& input_stream, LLAvatarAppearance* avatarp ); |