sbuild  1.4.26
sbuild-keyfile-base.h
00001 /* Copyright © 2005-2008  Roger Leigh <rleigh@debian.org>
00002  *
00003  * schroot is free software: you can redistribute it and/or modify it
00004  * 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  * schroot is distributed in the hope that it will be useful, but
00009  * WITHOUT ANY WARRANTY; without even the implied warranty of
00010  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011  * 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, see
00015  * <http://www.gnu.org/licenses/>.
00016  *
00017  *********************************************************************/
00018 
00019 #ifndef SBUILD_KEYFILE_BASE_H
00020 #define SBUILD_KEYFILE_BASE_H
00021 
00022 #include <sbuild/sbuild-i18n.h>
00023 #include <sbuild/sbuild-log.h>
00024 #include <sbuild/sbuild-parse-error.h>
00025 #include <sbuild/sbuild-parse-value.h>
00026 #include <sbuild/sbuild-types.h>
00027 #include <sbuild/sbuild-tr1types.h>
00028 #include <sbuild/sbuild-util.h>
00029 
00030 #include <cassert>
00031 #include <map>
00032 #include <string>
00033 #include <sstream>
00034 
00035 #include <boost/format.hpp>
00036 
00037 namespace sbuild
00038 {
00039 
00043   class keyfile_base
00044   {
00045   public:
00047     enum priority
00048       {
00049         PRIORITY_OPTIONAL,   
00050         PRIORITY_REQUIRED,   
00051         PRIORITY_DISALLOWED, 
00052         PRIORITY_DEPRECATED, 
00053         PRIORITY_OBSOLETE    
00054       };
00055 
00057     enum error_code
00058       {
00059         BAD_FILE,          
00060         DEPRECATED_KEY,    
00061         DEPRECATED_KEY_NL, 
00062         DISALLOWED_KEY,    
00063         DISALLOWED_KEY_NL, 
00064         DUPLICATE_GROUP,   
00065         DUPLICATE_KEY,     
00066         INVALID_GROUP,     
00067         INVALID_LINE,      
00068         MISSING_KEY,       
00069         MISSING_KEY_NL,    
00070         NO_GROUP,          
00071         NO_KEY,            
00072         OBSOLETE_KEY,      
00073         OBSOLETE_KEY_NL,   
00074         PASSTHROUGH_G,     
00075         PASSTHROUGH_GK,    
00076         PASSTHROUGH_LG,    
00077         PASSTHROUGH_LGK,   
00078         UNKNOWN_KEY        
00079       };
00080 
00082     typedef parse_error<error_code> error;
00083 
00085     keyfile_base ();
00086 
00088     virtual ~keyfile_base ();
00089 
00090   };
00091 
00092 }
00093 
00094 #endif /* SBUILD_KEYFILE_BASE_H */
00095 
00096 /*
00097  * Local Variables:
00098  * mode:C++
00099  * End:
00100  */