Forums  +  C++ and Sockets  +  C++ and SQL: MySQL, sqlite, ODBC  +  Miscellaneous Projects
Logo
~Database~
~ C++ ~
~Contact~

set_t.h

Go to the documentation of this file.
00001 /*
00002 set_t.h
00003 
00004 Copyright (C) 2004  Anders Hedstrom
00005 
00006 This program is made available under the terms of the GNU GPL.
00007 
00008 If you would like to use this program in a closed-source application,
00009 a separate license agreement is available. For information about 
00010 the closed-source license agreement for this program, please
00011 visit http://www.alhem.net/sqlwrapped/license.html and/or
00012 email license@alhem.net.
00013 
00014 This program is free software; you can redistribute it and/or
00015 modify it under the terms of the GNU General Public License
00016 as published by the Free Software Foundation; either version 2
00017 of the License, or (at your option) any later version.
00018 
00019 This program is distributed in the hope that it will be useful,
00020 but WITHOUT ANY WARRANTY; without even the implied warranty of
00021 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00022 GNU General Public License for more details.
00023 
00024 You should have received a copy of the GNU General Public License
00025 along with this program; if not, write to the Free Software
00026 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00027 */
00028 #ifndef _SET_T_H
00029 #define _SET_T_H
00030 
00031 #include <string>
00032 #include <map>
00033 #ifdef WIN32
00034 #include <config-win.h>
00035 #include <mysql.h>
00036 typedef unsigned __int64 uint64_t;
00037 #else
00038 #include <stdint.h>
00039 #endif
00040 
00041 #ifdef MYSQLW_NAMESPACE
00042 namespace MYSQLW_NAMESPACE {
00043 #endif
00044 
00045 
00047 class set_t
00048 {
00049 public:
00050         set_t(std::map<std::string, uint64_t>& );
00051 
00052         const std::string& String();
00053         uint64_t Value();
00054         const char *c_str();
00055 
00056         bool in_set(const std::string& );
00057 
00058         void operator=(const std::string& );
00059         void operator=(uint64_t);
00060         void operator|=(uint64_t);
00061         void operator&=(uint64_t);
00062         void operator+=(const std::string& );
00063         void operator-=(const std::string& );
00064 
00065 private:
00066         std::map<std::string, uint64_t>& m_mmap;
00067         uint64_t m_value;
00068         std::string m_strvalue;
00069 
00070 };
00071 
00072 
00073 #ifdef MYSQLW_NAMESPACE
00074 } // namespace MYSQLW_NAMESPACE {
00075 #endif
00076 
00077 #endif // _SET_T_H
Page, code, and content Copyright (C) 2006 by Anders Hedström