nis-util
1.0.D108
|
00001 // 00002 // nis-util - NIS Administration Utilities 00003 // Copyright (C) 2012 Peter Miller 00004 // 00005 // This program is free software; you can redistribute it and/or modify 00006 // it under the terms of the GNU General Public License as published by 00007 // the Free Software Foundation; either version 2 of the License, or (at 00008 // 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 GNU 00013 // General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU General Public License along 00016 // with this program. If not, see <http://www.gnu.org/licenses/>. 00017 // 00018 00019 #ifndef LIB_SPACE_AUTO_MASTER_H 00020 #define LIB_SPACE_AUTO_MASTER_H 00021 00022 #include <boost/shared_ptr.hpp> 00023 #include <list> 00024 00025 #include <lib/space.h> 00026 #include <lib/space/auto_master/row.h> 00027 00028 class space_auto_master_functor; // forward 00029 00034 class space_auto_master: 00035 public space 00036 { 00037 public: 00038 typedef boost::shared_ptr<space_auto_master> pointer; 00039 00043 virtual ~space_auto_master(); 00044 00049 static pointer create(const rcstring &filename); 00050 00054 void insert(const space_auto_master_row::pointer &rp); 00055 00059 void print(void) const; 00060 00064 void print(const rcstring &filename) const; 00065 00069 int yak_lex(void); 00070 00074 const source_location & 00075 yak_location(void) 00076 const 00077 { 00078 return get_location(); 00079 } 00080 00084 void read_and_process(void); 00085 00093 void walk(space_auto_master_functor &func); 00094 00099 static void grammar_debug(void); 00100 00101 private: 00106 space_auto_master(const rcstring &filename); 00107 00108 typedef std::list<space_auto_master_row::pointer> content_t; 00109 00114 content_t content; 00115 00123 space_auto_master(const space_auto_master &rhs); 00124 00132 space_auto_master &operator=(const space_auto_master &rhs); 00133 }; 00134 00135 // vim: set ts=8 sw=4 et : 00136 #endif // LIB_SPACE_AUTO_MASTER_H