/ src / emc / ini / emcIniFile.hh
emcIniFile.hh
 1  /******************************************************************************
 2   *
 3   * Copyright (C) 2007 Peter G. Vavaroutsos <pete AT vavaroutsos DOT com>
 4   *
 5   *
 6   * This program is free software; you can redistribute it and/or
 7   * modify it under the terms of version 2.1 of the GNU General
 8   * Public License as published by the Free Software Foundation.
 9   * This library is distributed in the hope that it will be useful,
10   * but WITHOUT ANY WARRANTY; without even the implied warranty of
11   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12   * GNU General Public License for more details.
13   *
14   * You should have received a copy of the GNU General Public
15   * License along with this library; if not, write to the Free Software
16   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17   *
18   * THE AUTHORS OF THIS LIBRARY ACCEPT ABSOLUTELY NO LIABILITY FOR
19   * ANY HARM OR LOSS RESULTING FROM ITS USE.  IT IS _EXTREMELY_ UNWISE
20   * TO RELY ON SOFTWARE ALONE FOR SAFETY.  Any machinery capable of
21   * harming persons must have provisions for completely removing power
22   * from all motors, etc, before persons enter any danger area.  All
23   * machinery must be designed to comply with local and national safety
24   * codes, and the authors of this software can not, and do not, take
25   * any responsibility for such compliance.
26   *
27   * This code was written as part of the EMC project.  For more
28   * information, go to www.linuxcnc.org.
29   *
30   ******************************************************************************/
31  
32  #ifndef _EMCINIFILE_HH_
33  #define _EMCINIFILE_HH_
34   
35  #include "emc.hh"
36  #include "inifile.hh"
37  
38  
39  class EmcIniFile : public IniFile {
40  public:
41                                  EmcIniFile(int errMask=0):IniFile(errMask){}
42  
43      ErrorCode                   Find(EmcJointType *result, const char *tag,
44                                       const char *section=NULL, int num = 1);
45      ErrorCode                   Find(bool *result, const char *tag,
46                                       const char *section, int num=1);
47      ErrorCode                   FindLinearUnits(EmcLinearUnits *result,
48                                                  const char *tag,
49                                                  const char *section=NULL,
50                                                  int num=1);
51      ErrorCode                   FindAngularUnits(EmcAngularUnits *result,
52                                                   const char *tag,
53                                                   const char *section=NULL,
54                                                   int num=1);
55  
56      // From base class.
57      ErrorCode                   Find(int *result, int min, int max,
58                                       const char *tag,const char *section,
59                                       int num=1){
60                                      return(IniFile::Find(result, min, max,
61                                                           tag, section, num));
62                                  }
63      ErrorCode                   Find(int *result, const char *tag,
64                                       const char *section=NULL, int num = 1){
65                                      return(IniFile::Find(result,
66                                                           tag, section, num));
67                                  }
68      ErrorCode                   Find(double *result, double min, double max,
69                                       const char *tag,const char *section,
70                                       int num=1){
71                                      return(IniFile::Find(result, min, max,
72                                                           tag, section, num));
73                                  }
74      ErrorCode                   Find(double *result, const char *tag,
75                                       const char *section=NULL, int num = 1){
76                                      return(IniFile::Find(result,
77                                                           tag, section, num));
78                                  }
79      const char *                Find(const char *tag, const char *section=NULL,
80                                       int num = 1){
81                                      return(IniFile::Find(tag, section, num));
82                                  }
83  
84  private:
85      static StrIntPair           jointTypeMap[];
86      static StrIntPair           boolMap[];
87      static StrDoublePair        linearUnitsMap[];
88      static StrDoublePair        angularUnitsMap[];
89  };
90  
91  
92  #endif