00001 
00032 #ifndef LLSIMURLSTRING_H
00033 #define LLSIMURLSTRING_H
00034 
00035 #include "llstring.h"
00036 
00037 class LLURLSimString
00038 {
00039 public:
00040         enum { NOT_SET=0, NOT_PARSED=1, PARSE_OK=2, PARSE_FAIL=-1 };
00041 
00042         static void setString(const LLString& url);
00043                 
00044                 
00045                 
00046                 
00047                 
00048 
00049         static bool parse();
00050                 
00051                 
00052                 
00053 
00054         static bool parse(const LLString& sim_string, std::string *region_name, S32 *x, S32 *y, S32 *z);
00055                 
00056                 
00057 
00058         static std::string getURL();
00059                 
00060         
00061         static std::string unescapeRegionName(std::string region_name);
00062                 
00063 
00064         LLURLSimString() : mX(128), mY(128), mZ(0), mParseState(NOT_PARSED) {}
00065 
00066 private:
00067         static S32 parseGridIdx(const LLString& in_string, S32 idx0, S32* res, S32 max);
00068 
00069 public:
00070         static LLURLSimString sInstance;
00071         static LLString sLocationStringHome;
00072         static LLString sLocationStringLast;
00073 
00074 public:
00075         LLString mSimString; 
00076         LLString mSimName;
00077         S32 mX,mY,mZ;
00078         S32 mParseState;
00079 };
00080 
00081 #endif