asName.h

Go to the documentation of this file.
00001 //   Copyright (C) 2007, 2008 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 
00024 class as_object;
00025 
00026 class asName
00027 {
00028 public:
00030         bool isRuntime() { return (mFlags & FLAG_RTNAME) != 0; }
00031 
00033         bool isRtns() { return (mFlags & FLAG_RTNS) != 0; }
00034 
00035         bool isQName() { return (mFlags & FLAG_QNAME) != 0; }
00036         void setQName() { mFlags |= FLAG_QNAME; }
00037 
00038         void setNamespace(asNamespace *ns) { mNamespace = ns; mPairName = 0; }
00039         asNamespace* getNamespace() const { return mNamespace; }
00040 
00041         string_table::key getName() const { return mName; }
00042         void setName(string_table::key n) { mName = n; mPairName = 0; }
00043 
00044         void setAttr() { mFlags |= FLAG_ATTR; }
00045 
00046         void fill(as_object*) {/*TODO*/}
00047 
00048         Property* findProperty();
00049 
00050         typedef enum
00051         {
00052                 KIND_Qname = 0x07,
00053                 KIND_QnameA = 0x0D,
00054                 KIND_RTQname = 0x0F,
00055                 KIND_RTQnameA = 0x10,
00056                 KIND_RTQnameL = 0x11,
00057                 KIND_RTQnameLA = 0x12,
00058                 KIND_Multiname = 0x09,
00059                 KIND_MultinameA = 0x0E,
00060                 KIND_MultinameL = 0x1B,
00061                 KIND_MultinameLA = 0x1C
00062         } kinds;
00063         typedef enum
00064         {
00065                 FLAG_ATTR = 0x01,
00066                 FLAG_QNAME = 0x02,
00067                 FLAG_RTNS = 0x04,
00068                 FLAG_RTNAME = 0x08,
00069                 FLAG_NSSET = 0x10
00070         } flags;
00071 
00072         boost::uint8_t mFlags;
00073         std::vector<asNamespace*> *mNamespaceSet;
00074 
00075         asName() : mFlags(0), mNamespaceSet(NULL), mName(0), mPairName(0),
00076                 mNamespace(NULL)
00077         {}
00078 private:
00079         string_table::key mName;
00080         string_table::key mPairName; // Pre-computed ns.name value
00081         asNamespace* mNamespace;
00082 };
00083 
00084 } // end of namespace gnash
00085 #endif /* GNASH_AS_NAME_H */

Generated on Thu Mar 6 18:25:06 2008 for Gnash by  doxygen 1.5.4