Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:27:54

0001 #ifndef __OOUC_A2X__
0002 #define __OOUC_A2X__
0003 /******************************************************************************/
0004 /*                                                                            */
0005 /*                          X r d O u c a 2 x . h h                           */
0006 /*                                                                            */
0007 /* (c) 2004 by the Board of Trustees of the Leland Stanford, Jr., University  */
0008 /*   Produced by Andrew Hanushevsky for Stanford University under contract    */
0009 /*              DE-AC02-76-SFO0515 with the Department of Energy              */
0010 /*                                                                            */
0011 /* This file is part of the XRootD software suite.                            */
0012 /*                                                                            */
0013 /* XRootD is free software: you can redistribute it and/or modify it under    */
0014 /* the terms of the GNU Lesser General Public License as published by the     */
0015 /* Free Software Foundation, either version 3 of the License, or (at your     */
0016 /* option) any later version.                                                 */
0017 /*                                                                            */
0018 /* XRootD is distributed in the hope that it will be useful, but WITHOUT      */
0019 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or      */
0020 /* FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public       */
0021 /* License for more details.                                                  */
0022 /*                                                                            */
0023 /* You should have received a copy of the GNU Lesser General Public License   */
0024 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file  */
0025 /* COPYING (GPL license).  If not, see <http://www.gnu.org/licenses/>.        */
0026 /*                                                                            */
0027 /* The copyright holder's institutional names and contributor's names may not */
0028 /* be used to endorse or promote products derived from this software without  */
0029 /* specific prior written permission of the institution or contributor.       */
0030 /******************************************************************************/
0031 
0032 #include "XrdSys/XrdSysError.hh"
0033 
0034 // This class is a holding area for various conversion utility routines
0035 //
0036 
0037 class XrdOuca2x
0038 {
0039 public:
0040 static int a2i( XrdSysError &, const char *emsg, const char *item, int *val, int minv=-1, int maxv=-1);
0041 static int a2ll(XrdSysError &, const char *emsg, const char *item, long long *val, long long minv=-1, long long maxv=-1);
0042 static int a2fm(XrdSysError &, const char *emsg, const char *item, int *val, int minv);
0043 static int a2fm(XrdSysError &, const char *emsg, const char *item, int *val, int minv, int maxv);
0044 static int a2p(XrdSysError  &, const char *ptype, const char *val, bool anyOK=true);
0045 static int a2sn(XrdSysError &, const char *emsg, const char *item,
0046                 int *val, int nScale, int minv=-1, int maxv=-1);
0047 static int a2sp(XrdSysError &, const char *emsg, const char *item, long long *val, long long minv=-1, long long maxv=-1);
0048 static int a2sz(XrdSysError &, const char *emsg, const char *item, long long *val, long long minv=-1, long long maxv=-1);
0049 static int a2tm(XrdSysError &, const char *emsg, const char *item, int *val, int minv=-1, int maxv=-1);
0050 static int a2vp(XrdSysError &, const char *emsg, const char *item, int *val, int minv=-1, int maxv=-1);
0051 
0052 static int b2x(const unsigned char* src, int slen, char* dst, int dlen);
0053 static int x2b(const char* src, int slen, unsigned char* dst, int dlen,
0054                bool radj=false);
0055 
0056 private:
0057 static int Emsg(XrdSysError &, const char *etxt1, const char *item,
0058                                const char *etxt2, double    val);
0059 static int Emsg(XrdSysError &, const char *etxt1, const char *item,
0060                                const char *etxt2, int       val);
0061 static int Emsg(XrdSysError &, const char *etxt1, const char *item,
0062                                const char *etxt2, long long val);
0063 };
0064 
0065 #endif