• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • Examples
  • File List
  • File Members

ObjectURI.h

Go to the documentation of this file.
00001 
00002 #ifndef GNASH_OBJECTURI_H
00003 #define GNASH_OBJECTURI_H
00004 
00005 #include "string_table.h"
00006 #include <string>
00007 #include <ostream>
00008 
00009 namespace gnash {
00010 
00012 //
00015 struct ObjectURI
00016 {
00017 
00018     class Logger;
00019 
00021     ObjectURI(string_table::key name)
00022         :
00023         name(name)
00024     {}
00025 
00026     string_table::key name;
00027 };
00028 
00030 inline bool
00031 operator==(const ObjectURI& a, const ObjectURI& b)
00032 {
00033     return a.name == b.name;
00034 }
00035 
00037 inline bool
00038 operator<(const ObjectURI& a, const ObjectURI& b)
00039 {
00040     return a.name < b.name;
00041 }
00042 
00044 inline string_table::key
00045 getName(const ObjectURI& o)
00046 {
00047     return o.name;
00048 }
00049 
00050 class ObjectURI::Logger
00051 {
00052 public:
00053     Logger(string_table& st) : _st(st) {}
00054 
00055     std::string operator()(const ObjectURI& uri) const {
00056         const string_table::key name = getName(uri);
00057         return _st.value(name);
00058     }
00059 private:
00060     string_table& _st;
00061 };
00062 
00063 } // namespace gnash
00064 #endif

Generated on Thu Sep 30 2010 14:35:01 for Gnash by  doxygen 1.7.1