diff options
Diffstat (limited to 'indra/newview/llsyntaxid.h')
-rw-r--r-- | indra/newview/llsyntaxid.h | 83 |
1 files changed, 57 insertions, 26 deletions
diff --git a/indra/newview/llsyntaxid.h b/indra/newview/llsyntaxid.h index f7e3d6896e..472e88744f 100644 --- a/indra/newview/llsyntaxid.h +++ b/indra/newview/llsyntaxid.h @@ -11,38 +11,40 @@ #include "llhttpclient.h" #include "llviewerregion.h" +/** + * @file llsyntaxid.h + * @brief Handles responses for the LSLSyntax capability's get call. + */ +class fetchKeywordsFileResponder : public LLHTTPClient::Responder +{ +public: + std::string mFileSpec; + + /** + * @brief fetchKeywordsFileResponder + * @param filespec File path and name of where to save the returned data + */ + fetchKeywordsFileResponder(std::string filespec); + + void errorWithContent(U32 status, + const std::string& reason, + const LLSD& content); + + /** + * @brief Saves the returned file to the location provided at instantiation. + * @param content_ref The LSL syntax file for the sim. + */ + void result(const LLSD& content_ref); +}; + /** * @file llsyntaxid.h - * @brief The LLSyntaxIdLSL class + * @brief Tracks the file needed to decorate the current sim's version of LSL. */ class LLSyntaxIdLSL { public: - LLSyntaxIdLSL(); - - bool checkSyntaxIdChanged(); - std::string getFileNameCurrent() const { return mFileNameCurrent; } - ELLPath getFilePath() const { return mFilePath; } - LLUUID getSyntaxId() const { return mCurrentSyntaxId; } - - void initialise(); - - static void setKeywordsXml(const LLSD& content) { sKeywordsXml = content; } - - -protected: - std::string buildFileName(LLUUID& SyntaxId); - bool fetchKeywordsFile(); - void openKeywordsFile(); - void setSyntaxId(LLUUID SyntaxId) { mCurrentSyntaxId = SyntaxId; } - void setFileNameCurrent(std::string& name) { mFileNameCurrent = name; } - void setFileNameDefault(std::string& name) { mFileNameDefault = name; } - void setFileNameNew(std::string& name) { mFileNameNew = name; } - void setSimulatorFeatureName(const std::string& name) { mSimulatorFeature = name; } - - -//public: protected: @@ -51,13 +53,42 @@ protected: private: std::string mCapabilityName; - LLUUID mCurrentSyntaxId; + std::string mCapabilityURL; std::string mFileNameCurrent; std::string mFileNameDefault; std::string mFileNameNew; ELLPath mFilePath; std::string mFullFileSpec; std::string mSimulatorFeature; + LLUUID mSyntaxIdCurrent; + LLUUID mSyntaxIdNew; static LLSD sKeywordsXml; + + +public: + LLSyntaxIdLSL(); + + bool checkSyntaxIdChanged(); + std::string getFileNameCurrent() const { return mFileNameCurrent; } + ELLPath getFilePath() const { return mFilePath; } + std::string getFileSpec() const { return mFullFileSpec; } + LLSD getKeywordsXML() const { return sKeywordsXml; } + LLUUID getSyntaxId() const { return mSyntaxIdCurrent; } + + void initialise(); + + static void setKeywordsXml(const LLSD& content) { sKeywordsXml = content; } + + +protected: + std::string buildFileNameNew(); + std::string buildFullFileSpec(); + void fetchKeywordsFile(); + bool loadKeywordsIntoLLSD(); + void setSyntaxId(LLUUID SyntaxId) { mSyntaxIdCurrent = SyntaxId; } + void setFileNameCurrent(std::string& name) { mFileNameCurrent = name; } + void setFileNameDefault(std::string& name) { mFileNameDefault = name; } + void setFileNameNew(std::string name) { mFileNameNew = name; } + void setSimulatorFeatureName(const std::string& name) { mSimulatorFeature = name; } }; |