NCBI C++ ToolKit
ncbictype.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef CORELIB___NCBICTYPE__HPP
2 #define CORELIB___NCBICTYPE__HPP
3 
4 /* $Id: ncbictype.hpp 72379 2016-05-04 15:18:35Z ivanov $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Author: Denis Vakatov, Eugene Vasilchenko
30  *
31  *
32  */
33 
34 /// @file ncbictype.hpp
35 /// Catch attempts to call ctype functions with bad types
36 
37 
38 #include <corelib/ncbistl.hpp>
39 #include <corelib/ncbitype.h>
40 #include <cctype>
41 
42 #if !defined(NCBI_NO_STRICT_CTYPE_ARGS)
43 # define NCBI_STRICT_CTYPE_ARGS
44 #endif
45 
46 #ifdef NCBI_STRICT_CTYPE_ARGS
47 
48 # define NCBI_STRICT_CTYPE_ARGS_ACTIVE
49 
51 
52 #define NCBI_DEFINE_CTYPE_FUNC(name) \
53  inline int name(Uchar c) { return name(int(c)); } \
54  inline int name(char c) { return name(Uchar(c)); } \
55  template<class C> inline int name(C c) \
56  { \
57  return See_the_standard_on_proper_argument_type_for_ctype_functions(c); \
58  return 0; /* to avoid a compilation warning */ \
59  }
60 
74 //NCBI_DEFINE_CTYPE_FUNC(isblank)
75 //NCBI_DEFINE_CTYPE_FUNC(isascii)
76 //NCBI_DEFINE_CTYPE_FUNC(toascii)
77 
78 #undef NCBI_DEFINE_CTYPE_FUNC
79 
81 
82 #endif // NCBI_STRICT_CTYPE_ARGS
83 
84 #endif /* CORELIB___NCBICTYPE__HPP */
#define NCBI_DEFINE_CTYPE_FUNC(name)
Definition: ncbictype.hpp:52
BEGIN_STD_NAMESPACE
Definition: ncbictype.hpp:50
int isalpha(Uchar c)
Definition: ncbictype.hpp:61
int isspace(Uchar c)
Definition: ncbictype.hpp:69
int isalnum(Uchar c)
Definition: ncbictype.hpp:62
END_STD_NAMESPACE
Definition: ncbictype.hpp:80
int tolower(Uchar c)
Definition: ncbictype.hpp:72
int isxdigit(Uchar c)
Definition: ncbictype.hpp:71
int isdigit(Uchar c)
Definition: ncbictype.hpp:64
int toupper(Uchar c)
Definition: ncbictype.hpp:73
int isgraph(Uchar c)
Definition: ncbictype.hpp:65
int isprint(Uchar c)
Definition: ncbictype.hpp:67
int ispunct(Uchar c)
Definition: ncbictype.hpp:68
int islower(Uchar c)
Definition: ncbictype.hpp:66
int isupper(Uchar c)
Definition: ncbictype.hpp:70
int iscntrl(Uchar c)
Definition: ncbictype.hpp:63
The NCBI C++/STL use hints.
Defines Limits for the types used in NCBI C/C++ toolkit.
Modified on Fri Apr 26 16:29:07 2024 by modify_doxy.py rev. 669887