Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

Href.h

Go to the documentation of this file.
00001 #ifndef Impala_Core_IDash_Href_h
00002 #define Impala_Core_IDash_Href_h
00003 
00004 #include "Util/StringParser.h"
00005 
00006 namespace Impala
00007 {
00008 namespace Core
00009 {
00010 namespace IDash
00011 {
00012 
00013 
00017 class Href
00018 {
00019 public:
00020 
00021     Href(String ref)
00022     {
00023         mRef = ref;
00024     }
00025 
00026     String
00027     AsString() const
00028     {
00029         return mRef;
00030     }
00031 
00032     bool
00033     Empty() const
00034     {
00035         return mRef.empty();
00036     }
00037 
00038     String
00039     GetVideoId() const
00040     {
00041         Util::StringParser p(mRef);
00042         if (! p.Contains("videos"))
00043             return "";
00044         p.Eat("videos/");
00045         if (p.TheEnd())
00046             return "";
00047         return p.GetString('/', false);
00048     }
00049 
00050     String
00051     GetCaseId() const
00052     {
00053         Util::StringParser p(mRef);
00054         if (! p.Contains("cases"))
00055             return "";
00056         p.Eat("cases/");
00057         if (p.TheEnd())
00058             return "";
00059         return p.GetString('/', false);
00060     }
00061 
00062 private:
00063 
00064     String mRef;
00065 
00066     ILOG_VAR_DEC;
00067 
00068 };
00069 
00070 ILOG_VAR_INIT(Href, Impala.Core.IDash);
00071 
00072 } // namespace IDash
00073 } // namespace Core
00074 } // namespace Impala
00075 
00076 #endif

Generated on Fri Mar 19 09:31:11 2010 for ImpalaSrc by  doxygen 1.5.1