Annotation of /trunk/linden/indra/newview/llurlsimstring.h
Parent Directory
|
Revision Log
Revision 57 -
(view)
(download)
Original Path: linden_release/linden/indra/newview/llurlsimstring.h
| 1 : | mjm | 57 | /** |
| 2 : | * @file llsimurlstring.h | ||
| 3 : | * @brief Handles "SLURL fragments" like Ahern/123/45 for | ||
| 4 : | * startup processing, login screen, prefs, etc. | ||
| 5 : | * | ||
| 6 : | * $LicenseInfo:firstyear=2006&license=viewergpl$ | ||
| 7 : | * | ||
| 8 : | * Copyright (c) 2006-2008, Linden Research, Inc. | ||
| 9 : | * | ||
| 10 : | * Second Life Viewer Source Code | ||
| 11 : | * The source code in this file ("Source Code") is provided by Linden Lab | ||
| 12 : | * to you under the terms of the GNU General Public License, version 2.0 | ||
| 13 : | * ("GPL"), unless you have obtained a separate licensing agreement | ||
| 14 : | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
| 15 : | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
| 16 : | * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 | ||
| 17 : | * | ||
| 18 : | * There are special exceptions to the terms and conditions of the GPL as | ||
| 19 : | * it is applied to this Source Code. View the full text of the exception | ||
| 20 : | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
| 21 : | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
| 22 : | * | ||
| 23 : | * By copying, modifying or distributing this software, you acknowledge | ||
| 24 : | * that you have read and understood your obligations described above, | ||
| 25 : | * and agree to abide by those obligations. | ||
| 26 : | * | ||
| 27 : | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
| 28 : | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
| 29 : | * COMPLETENESS OR PERFORMANCE. | ||
| 30 : | * $/LicenseInfo$ | ||
| 31 : | */ | ||
| 32 : | #ifndef LLSIMURLSTRING_H | ||
| 33 : | #define LLSIMURLSTRING_H | ||
| 34 : | |||
| 35 : | #include "llstring.h" | ||
| 36 : | |||
| 37 : | class LLURLSimString | ||
| 38 : | { | ||
| 39 : | public: | ||
| 40 : | enum { NOT_SET=0, NOT_PARSED=1, PARSE_OK=2, PARSE_FAIL=-1 }; | ||
| 41 : | |||
| 42 : | static void setString(const std::string& url); | ||
| 43 : | // Accepts all sorts of fragments: | ||
| 44 : | // secondlife://RegionName/1/2/ | ||
| 45 : | // sl://RegionName/1/2/3/ | ||
| 46 : | // //Ahern/123/45/ | ||
| 47 : | // Ahern | ||
| 48 : | |||
| 49 : | static bool parse(); | ||
| 50 : | // Returns true if we have an URL fragment in the static instance | ||
| 51 : | // (and it parsed correctly, which is basically always because | ||
| 52 : | // any bare region string is a valid fragment). | ||
| 53 : | |||
| 54 : | static bool parse(const std::string& sim_string, std::string *region_name, S32 *x, S32 *y, S32 *z); | ||
| 55 : | // Parse a sim string "Ahern/1/2" and return location data, | ||
| 56 : | // doesn't affect static instance. | ||
| 57 : | |||
| 58 : | static std::string getURL(); | ||
| 59 : | // Get the canonical URL secondlife://RegionName/123/45/6/ | ||
| 60 : | |||
| 61 : | static std::string unescapeRegionName(std::string region_name); | ||
| 62 : | // Does URL unescaping, in particular %20 -> space | ||
| 63 : | |||
| 64 : | LLURLSimString() : mX(128), mY(128), mZ(0), mParseState(NOT_PARSED) {} | ||
| 65 : | |||
| 66 : | private: | ||
| 67 : | static std::string::size_type parseGridIdx(const std::string& in_string, | ||
| 68 : | std::string::size_type idx0, | ||
| 69 : | std::string::size_type* res); | ||
| 70 : | |||
| 71 : | public: | ||
| 72 : | static LLURLSimString sInstance; | ||
| 73 : | static std::string sLocationStringHome; | ||
| 74 : | static std::string sLocationStringLast; | ||
| 75 : | |||
| 76 : | public: | ||
| 77 : | std::string mSimString; // "name/x/y/z" | ||
| 78 : | std::string mSimName; | ||
| 79 : | S32 mX,mY,mZ; | ||
| 80 : | S32 mParseState; | ||
| 81 : | }; | ||
| 82 : | |||
| 83 : | #endif |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |

