Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

boss_context.h

Go to the documentation of this file.
00001 /* boss_context.cpp    $Revision: 1.3 $ $Date: 2005/12/10 20:33:54 $
00002    Copyright (C) 2002 University of Bonn.
00003    http://www.ikp.uni-bonn.de/boss
00004 
00005    This program is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU General Public License
00007    as published by the Free Software Foundation; either version 2
00008    of the License, or (at your option) any later version.
00009 
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013    GNU General Public License for more details.
00014 
00015    You should have received a copy of the GNU General Public License
00016    along with this program; if not, write to the Free Software
00017    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. */
00018 
00023 #ifndef BOSSCONTEXT_H
00024 #define BOSSCONTEXT_H
00025 
00026 using namespace std;
00027 
00028 #include <iostream>
00029 #include <fstream>
00030 #include <string>
00031 #include <sstream>
00032 #include <map>
00033 
00034 struct CCStruct {
00035   string left1;
00036   string right1;
00037   string left2;
00038   string right2;
00039 };
00040 
00041 class BOSS_context {
00042  public:
00043   BOSS_context(string & file);
00044   string left1(const string & s) {
00045     if((cmi = cmap.find(s)) == cmap.end()) return "";
00046     else return (*cmi).second.left1;
00047   }
00048   string right1(const string & s) {
00049     if((cmi = cmap.find(s)) == cmap.end()) return "";
00050     else return (*cmi).second.right1;
00051   }
00052   string left2(const string & s) {
00053     if((cmi = cmap.find(s)) == cmap.end()) return "";
00054     else return (*cmi).second.left2;
00055   }
00056   string right2(const string & s) {
00057     if((cmi = cmap.find(s)) == cmap.end()) return "";
00058     else return (*cmi).second.right2;
00059   }
00060  protected:
00061   map< string,CCStruct > cmap;
00062   map< string,CCStruct >::const_iterator cmi;
00063 };
00064 
00065 #endif
00066 
00067 

Generated on Tue Dec 20 23:14:37 2005 for BOSS by doxygen 1.3.6