PageRenderTime 162ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/newview/llurl.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 95 lines | 29 code | 16 blank | 50 comment | 0 complexity | 1b1121f64e7de1d4a1cf6ab034b0b3eb MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llurl.h
  3. * @brief Text url class
  4. *
  5. * $LicenseInfo:firstyear=2001&license=viewerlgpl$
  6. * Second Life Viewer Source Code
  7. * Copyright (C) 2010, Linden Research, Inc.
  8. *
  9. * This library is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU Lesser General Public
  11. * License as published by the Free Software Foundation;
  12. * version 2.1 of the License only.
  13. *
  14. * This library is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public
  20. * License along with this library; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  22. *
  23. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  24. * $/LicenseInfo$
  25. */
  26. #ifndef LL_LLURL_H
  27. #define LL_LLURL_H
  28. // splits a URL into its parts, which are:
  29. //
  30. // [URI][AUTHORITY][PATH][FILENAME][EXTENSION][TAG]
  31. //
  32. // e.g. http://www.lindenlab.com/early/bite_me.html#where
  33. //
  34. // URI= "http"
  35. // AUTHORITY= "www.lindenlab.com"
  36. // PATH= "/early/"
  37. // FILENAME= "bite_me"
  38. // EXTENSION= "html"
  39. // TAG= "where"
  40. //
  41. //
  42. // test cases:
  43. //
  44. // http://www.lindenlab.com/early/bite_me.html#where
  45. // http://www.lindenlab.com/
  46. // http://www.lindenlab.com
  47. // www.lindenlab.com ?
  48. // early/bite_me.html#where
  49. // mailto://test@lindenlab.com
  50. // mailto:test@lindenlab.com
  51. //
  52. //
  53. class LLURL
  54. {
  55. public:
  56. LLURL();
  57. LLURL(const LLURL &url);
  58. LLURL(const char * url);
  59. LLURL &operator=(const LLURL &rhs);
  60. virtual ~LLURL();
  61. virtual void init (const char * url);
  62. virtual void cleanup ();
  63. bool operator==(const LLURL &rhs) const;
  64. bool operator!=(const LLURL &rhs) const;
  65. virtual const char *getFQURL() const;
  66. virtual const char *getFullPath();
  67. virtual const char *getAuthority();
  68. virtual const char *updateRelativePath(const LLURL &url);
  69. virtual BOOL isExtension(const char *compare) {return (!strcmp(mExtension,compare));};
  70. public:
  71. char mURI[LL_MAX_PATH]; /* Flawfinder: ignore */
  72. char mAuthority[LL_MAX_PATH]; /* Flawfinder: ignore */
  73. char mPath[LL_MAX_PATH]; /* Flawfinder: ignore */
  74. char mFilename[LL_MAX_PATH]; /* Flawfinder: ignore */
  75. char mExtension[LL_MAX_PATH]; /* Flawfinder: ignore */
  76. char mTag[LL_MAX_PATH]; /* Flawfinder: ignore */
  77. static char sReturnString[LL_MAX_PATH]; /* Flawfinder: ignore */
  78. };
  79. #endif // LL_LLURL_H