nis-util  1.0.D108
lib/configuration/item.cc
Go to the documentation of this file.
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 #include <lib/configuration/item.h>
00020 #include <lib/sizeof.h>
00021 
00022 
00023 configuration_item::~configuration_item()
00024 {
00025 }
00026 
00027 
00028 configuration_item::configuration_item(
00029     const source_location &a_locn,
00030     level_t a_level,
00031     const rcstring &a_name
00032 ) :
00033     locn(a_locn),
00034     level(a_level),
00035     name(a_name)
00036 {
00037 }
00038 
00039 
00040 const char *
00041 configuration_item::level_name(level_t value)
00042 {
00043     switch (value)
00044     {
00045     case level_builtin:
00046         return "level_builtin";
00047 
00048     case level_etc_nis_util_conf:
00049         return "level_etc_nis_util_conf";
00050 
00051     case level_home_nis_util_rc:
00052         return "level_home_nis_util_rc";
00053 
00054     case level_nis_util_env:
00055         return "level_nis_util_env";
00056 
00057     case level_nis_util_prog_env:
00058         return "level_nis_util_prog_env";
00059 
00060     case level_command_line_file:
00061         return "level_command_line_file";
00062 
00063     case level_command_line_option:
00064         return "level_command_line_option";
00065     }
00066     return "?";
00067 }
00068 
00069 
00070 // vim: set ts=8 sw=4 et :