Gnash 0.8.9
|
00001 // Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. 00002 // 00003 // This program is free software; you can redistribute it and/or modify 00004 // it under the terms of the GNU General Public License as published by 00005 // the Free Software Foundation; either version 3 of the License, or 00006 // (at your option) any later version. 00007 // 00008 // This program is distributed in the hope that it will be useful, 00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00011 // GNU General Public License for more details. 00012 // 00013 // You should have received a copy of the GNU General Public License 00014 // along with this program; if not, write to the Free Software 00015 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00016 00017 #ifndef GNASH_AS_NAME_H 00018 #define GNASH_AS_NAME_H 00019 00020 #include <vector> 00021 00022 namespace gnash { 00023 class as_object; 00024 class Property; 00025 namespace abc { 00026 class Namespace; 00027 } 00028 } 00029 00030 namespace gnash { 00031 namespace abc { 00032 00034 // 00040 typedef size_t URI; 00041 00043 // 00047 // 00049 class MultiName 00050 { 00051 public: 00052 00053 enum Kind 00054 { 00055 KIND_Qname = 0x07, 00056 KIND_QnameA = 0x0D, 00057 KIND_RTQname = 0x0F, 00058 KIND_RTQnameA = 0x10, 00059 KIND_RTQnameL = 0x11, 00060 KIND_RTQnameLA = 0x12, 00061 KIND_Multiname = 0x09, 00062 KIND_MultinameA = 0x0E, 00063 KIND_MultinameL = 0x1B, 00064 KIND_MultinameLA = 0x1C 00065 }; 00066 00067 MultiName() 00068 : 00069 _flags(0), 00070 _namespaceSet(0), 00071 _abcName(0), 00072 _globalName(0), 00073 _namespace(0) 00074 {} 00075 00076 void setFlags(Kind kind) { 00077 _flags = kind; 00078 } 00079 00080 boost::uint8_t flags() const { 00081 return _flags; 00082 } 00083 00085 bool isRuntime() { return _flags & FLAG_RTNAME; } 00086 00088 bool isRtns() { return _flags & FLAG_RTNS; } 00089 00090 bool isQName() { return _flags & FLAG_QNAME; } 00091 void setQName() { _flags |= FLAG_QNAME; } 00092 00093 void setNamespace(Namespace *ns) { _namespace = ns; } 00094 Namespace* getNamespace() const { return _namespace; } 00095 00096 abc::URI getABCName() const { return _abcName; } 00097 void setABCName(abc::URI n) { _abcName = n;} 00098 00099 string_table::key getGlobalName() const { return _globalName;} 00100 void setGlobalName(string_table::key n) { _globalName = n;} 00101 00102 void setAttr() { _flags |= FLAG_ATTR; } 00103 00104 void fill(as_object*) {} 00105 00106 Property* findProperty(); 00107 00108 void namespaceSet(std::vector<Namespace*>* v) { 00109 _namespaceSet = v; 00110 } 00111 00112 const std::vector<Namespace*>* namespaceSet() const { 00113 return _namespaceSet; 00114 } 00115 00116 private: 00117 00118 enum Flag 00119 { 00120 FLAG_ATTR = 0x01, 00121 FLAG_QNAME = 0x02, 00122 FLAG_RTNS = 0x04, 00123 FLAG_RTNAME = 0x08, 00124 FLAG_NSSET = 0x10 00125 }; 00126 00127 boost::uint8_t _flags; 00128 00129 std::vector<Namespace*>* _namespaceSet; 00130 00131 abc::URI _abcName; 00132 00133 string_table::key _globalName; 00134 00135 Namespace* _namespace; 00136 00137 }; 00138 00139 } // namespace abc 00140 } // namespace gnash 00141 #endif