diff options
Diffstat (limited to 'indra/newview/llsyntaxid.h')
-rw-r--r-- | indra/newview/llsyntaxid.h | 86 |
1 files changed, 54 insertions, 32 deletions
diff --git a/indra/newview/llsyntaxid.h b/indra/newview/llsyntaxid.h index b968dd233d..226f1f4941 100644 --- a/indra/newview/llsyntaxid.h +++ b/indra/newview/llsyntaxid.h @@ -37,32 +37,6 @@ #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 @@ -70,12 +44,21 @@ public: */ class LLSyntaxIdLSL { +friend class fetchKeywordsFileResponder; public: +static const std::string CAPABILITY_NAME; +static const std::string FILENAME_DEFAULT; +static const std::string SIMULATOR_FEATURE; protected: - LLViewerRegion* region; + //LLViewerRegion* region; + static bool sInitialised; + static LLSD sKeywordsXml; + static bool sLoaded; + static bool sLoadFailed; + static bool sVersionChanged; private: std::string mCapabilityName; @@ -89,21 +72,25 @@ private: LLUUID mSyntaxIdCurrent; LLUUID mSyntaxIdNew; - static LLSD sKeywordsXml; - public: LLSyntaxIdLSL(); + LLSyntaxIdLSL(std::string filenameDefault, std::string simFeatureName, std::string capabilityName); bool checkSyntaxIdChanged(); + bool fetching(); 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; } + bool isDifferentVersion() const { return sVersionChanged; } + bool isInitialised() const { return sInitialised; } void initialise(); + bool isLoaded() { return sLoaded; } + static bool isSupportedVersion(const LLSD& content); static void setKeywordsXml(const LLSD& content) { sKeywordsXml = content; } @@ -111,11 +98,46 @@ protected: std::string buildFileNameNew(); std::string buildFullFileSpec(); void fetchKeywordsFile(); - void loadDefaultKeywordsIntoLLSD(const std::string message); - bool loadKeywordsIntoLLSD(); + void loadDefaultKeywordsIntoLLSD(); + void 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; } +// void setSimulatorFeatureName(const std::string& name) { mSimulatorFeature = name; } +}; + + +/** + * @file llsyntaxid.h + * @brief Handles responses for the LSLSyntax capability's get call. Is a friend of LLSyntaxIdLSL + */ +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 Checks the returned LLSD for version and stores it in the LLSyntaxIdLSL object. + * @param content_ref The returned LLSD. + */ + void result(const LLSD& content_ref); + + /** + * @brief Saves the returned file to the location provided at instantiation. + * Could be extended to manage cached entries. + * @param content_ref The LSL syntax file for the sim. + */ + void cacheFile(const LLSD& content_ref); + }; |