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

Go to the SVN repository for this file.

1 #ifndef APP_PROJECT_TREE_BUILDER___PTB_ERROR_CODES___HPP
2 #define APP_PROJECT_TREE_BUILDER___PTB_ERROR_CODES___HPP
3 
4 /* $Id: ptb_err_codes.hpp 37307 2008-03-25 16:45:09Z gouriano $
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  * Authors: Mike DiCuccio
30  *
31  * File Description:
32  *
33  */
34 
35 #include <corelib/ncbistd.hpp>
36 
38 
39 
41 {
44 
57 };
58 
59 
60 /////////////////////////////////////////////////////////////////////////////
61 ///
62 /// MDiagFile --
63 ///
64 /// Manipulator to set File for CNcbiDiag
65 
66 class MDiagFile
67 {
68 public:
69  MDiagFile(const string& file, int line = 0)
70  : m_File(file)
71  , m_Line(line)
72  {
73  }
74 
75  friend const CNcbiDiag& operator<< (const CNcbiDiag& diag,
76  const MDiagFile& file)
77  {
78  //return diag;
79  return diag.SetFile(file.m_File.c_str()).SetLine(file.m_Line);
80  }
81 
82 private:
83  string m_File;
84  int m_Line;
85 };
86 
87 
88 
89 
90 
91 #define PTB_ERROR(file, msg) \
92  ERR_POST(Error << MDiagFile(file) << ": " << msg)
93 
94 #define PTB_ERROR_EX(file, err_code, msg) \
95  ERR_POST(Error << MDiagFile(file) << ErrCode(err_code) << msg)
96 
97 #define PTB_WARNING(file, msg) \
98  ERR_POST(Warning << MDiagFile(file) << ": " << msg)
99 
100 #define PTB_WARNING_EX(file, err_code, msg) \
101  ERR_POST(Warning << MDiagFile(file) << ErrCode(err_code) << msg)
102 
103 #define PTB_INFO(msg) \
104  ERR_POST(Info << MDiagFile(kEmptyStr) << ErrCode(ePTB_NoError) << msg)
105 
106 #define PTB_INFO_EX(file, err_code, msg) \
107  ERR_POST(Info << MDiagFile(file) << ErrCode(err_code) << msg)
108 
109 #define PTB_TRACE(msg) \
110  _TRACE(Trace << ErrCode(ePTB_NoError) << msg)
111 
112 #define PTB_TRACE_EX(file, err_code, msg) \
113  _TRACE(Trace << MDiagFile(file) << ErrCode(err_code) << msg)
114 
115 
116 
118 
119 #endif // APP_PROJECT_TREE_BUILDER___PTB_ERROR_CODES___HPP
CNcbiDiag –.
Definition: ncbidiag.hpp:924
MDiagFile –.
friend const CNcbiDiag & operator<<(const CNcbiDiag &diag, const MDiagFile &file)
string m_File
MDiagFile(const string &file, int line=0)
Include a standard set of the NCBI C++ Toolkit most basic headers.
const CNcbiDiag & SetLine(size_t line) const
Set line number for post.
const CNcbiDiag & SetFile(const char *file) const
Set file name to post.
Definition: ncbidiag.cpp:7746
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
FILE * file
EProjectTreeBuilderErrCode
@ ePTB_MacroInvalid
@ ePTB_MissingDependency
@ ePTB_FileModified
@ ePTB_ProjectExcluded
@ ePTB_Unknown
@ ePTB_ProjectNotFound
@ ePTB_NoError
@ ePTB_InvalidMakefile
@ ePTB_FileNotFound
@ ePTB_ConfigurationError
@ ePTB_PathNotFound
@ ePTB_MissingMakefile
@ ePTB_FileExcluded
@ ePTB_MacroUndefined
Modified on Thu Feb 29 12:24:43 2024 by modify_doxy.py rev. 669887