Fawkes API Fawkes Development Version

field.h

00001  
00002 /***************************************************************************
00003  *  field.h - Interface generator field representation
00004  *
00005  *  Generated: Wed Oct 11 18:09:57 2006
00006  *  Copyright  2006  Tim Niemueller [www.niemueller.de]
00007  *
00008  ****************************************************************************/
00009 
00010 /*  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version.
00014  *
00015  *  This program is distributed in the hope that it will be useful,
00016  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  *  GNU Library General Public License for more details.
00019  *
00020  *  Read the full text in the LICENSE.GPL file in the doc directory.
00021  */
00022 
00023 #ifndef __INTERFACES_GENERATOR_FIELD_H_
00024 #define __INTERFACES_GENERATOR_FIELD_H_
00025 
00026 #include <string>
00027 #include <vector>
00028 
00029 #include <interfaces/generator/enum_constant.h>
00030 
00031 class InterfaceField
00032 {
00033  public:
00034   InterfaceField(std::vector<InterfaceEnumConstant> *enum_constants = NULL);
00035 
00036   void setComment(const std::string &comment);
00037   void setName(const std::string &name);
00038   void setType(const std::string &type);
00039   bool isEnumType() const;
00040   void setLength(const std::string &length);
00041   void setFlags(const std::vector<std::string> &flags);
00042   void setValidFor(const std::string &validfor);
00043   void setDefaultValue(const std::string &default_value);
00044 
00045   void setAttribute(const std::string &attr_name, const std::string &attr_value);
00046 
00047   void valid();
00048 
00049   std::string               getName() const;
00050   std::string               getComment() const;
00051   std::string               getType() const;
00052   std::string               getAccessType() const;
00053   std::string               getStructType() const;
00054   std::string               getPlainAccessType() const;
00055   std::string               getLength() const;
00056   unsigned int              getLengthValue() const;
00057   std::vector<std::string>  getFlags() const;
00058   std::string               getValidFor() const;
00059   std::string               getDefaultValue() const;
00060 
00061   bool operator< (const InterfaceField &f) const;
00062 
00063  private:
00064   void tokenize(const std::string&   str,
00065                 std::vector<std::string>& tokens,
00066                 const std::string&   delimiters = " ");
00067 
00068 
00069   std::string name;
00070   std::string type;
00071   bool        is_enum_type;
00072   std::string comment;
00073   std::string length;
00074   unsigned int length_value;
00075   std::string validfor;
00076   std::string default_value;
00077   std::vector<std::string> flags;
00078   std::vector<InterfaceEnumConstant> *enum_constants;
00079 
00080 };
00081 
00082 #endif
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends