IOFunctions.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2012 SCHUNK GmbH & Co. KG
00003  * Copyright (c) 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
00004  *
00005  * Licensed under the Apache License, Version 2.0 (the "License");
00006  * you may not use this file except in compliance with the License.
00007  * You may obtain a copy of the License at
00008  *
00009  *   http://www.apache.org/licenses/LICENSE-2.0
00010 
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS,
00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  */
00017 
00018 #ifndef UTIL_IOFUNCTIONS_H
00019 #define UTIL_IOFUNCTIONS_H
00020 
00021 // ---- global includes ----------------------------------------------------- ;
00022 
00023 #include "../Util/GlobalDefines.h"
00024 #include <stdio.h>
00025 #include <stdlib.h>     // to use getenv
00026 #include <iostream>
00027 
00028 #if defined(__QNX__) && defined(__WATCOMC__)
00029 #include <iomanip>
00030 #endif
00031 
00032 // ---- constants ----------------------------------------------------------- ;
00033 
00034 const int BUFFER_LENGTH        = 256;
00035 
00036 const int OKAY                 = 0;
00037 const int KEY_BUT_NO_EQUAL     = 1;
00038 const int NO_KEY               = 2;
00039 const int FOUND_EOF            = 3;
00040 const int NO_OPEN_BRACKET      = 4;
00041 const int NO_SEPERATOR         = 5;
00042 const int NO_CLOSED_BRACKET    = 6;
00043 const int KEY_BUT_WRONG_NUMBER = 7;
00044 
00045 // ---- local includes ------------------------------------------------------ ;
00046 
00047 // ---- local functions ----------------------------------------------------- ;
00048 
00049 int util_searchString(const char* acSectionName, const char* acKeyName, const char* acDefaultString, char* acReturnString, int iSize, const char* acFileName);
00050 
00051 int util_setString(const char* acSectionName, const char* acKeyName, const char* acString, const char* acFileName);
00052 
00053 #ifdef WITHSTREAMS
00054 // checks for a given keyword and positions the stream at the
00055 //              corresponding argument
00056 int  util_posArgForKey(
00057                                 std::istream&   clIn,
00058                                 const char*             acKey,
00059                                 int                             iNumber = -1,
00060                                 char                    cDelim = '=');
00061 
00062 // generates error messsages according to a error status 
00063 //              returned for example by posArgForKey(..)
00064 void util_parseError(int                iStatus,
00065                 const char*             acKey,
00066                 int                             iNumber = -1);
00067 
00068 // combines posArgForKey(..) and parseError(..) to one function call
00069 void util_posArgForKeyWithCheck(
00070                                 std::istream&   clIn,
00071                                 const char*             acKey,
00072                                 int                             iNumber = -1,
00073                                 char                    cDelim = '=');
00074 
00075 #endif // WITHSTREAMS
00076 #endif // UTIL_IOFUNCTIONS_H


schunk_libm5api
Author(s): Florian Weisshardt
autogenerated on Sat Jun 8 2019 20:25:13