CodeLocation.h
1 //##################################################################################################
2 //
3 // Ceetron Desktop Components
4 // Component: Core
5 //
6 // --------------------------------------------------------------------------------------------
7 // Copyright (C) 2011, Ceetron AS
8 // This is UNPUBLISHED PROPRIETARY SOURCE CODE of Ceetron AS. The contents of this file may
9 // not be disclosed to third parties, copied or duplicated in any form, in whole or in part,
10 // without the prior written permission of Ceetron AS.
11 //##################################################################################################
12 
13 #pragma once
14 
15 namespace cee {
16 
17 
18 //==================================================================================================
19 //
20 //
21 //
22 //==================================================================================================
23 class CEE_CORE_EXPORT CodeLocation
24 {
25 public:
26  CodeLocation();
27  CodeLocation(const char* fileName, const char* functionName, int lineNumber);
28  CodeLocation(const CodeLocation& other);
29 
30  const CodeLocation& operator=(CodeLocation rhs);
31 
32  const char* fileName() const;
33  const char* shortFileName() const;
34  const char* functionName() const;
35  int lineNumber() const;
36  void swap(CodeLocation& other);
37 
38 private:
39  const char* m_fileName;
40  const char* m_functionName;
41  int m_lineNumber;
42 };
43 
44 } // namespace cee
45 
46 
47 #if defined(_MSC_VER)
48 #define CEE_CODELOC_FUNCNAME __FUNCSIG__
49 #elif defined(__GNUC__)
50 #define CEE_CODELOC_FUNCNAME __PRETTY_FUNCTION__
51 #else
52 #define CEE_CODELOC_FUNCNAME ""
53 #endif
54 
55 #define CEE_CODE_LOCATION ::cee::CodeLocation(__FILE__, CEE_CODELOC_FUNCNAME, __LINE__)
56 
57 
Namespace cee contains all functionality and structures under the Core component. ...
Definition: AppComponent.cpp:26
void swap(PtrRef< T > &a, PtrRef< T > &b)
Swap contents of a and b. Matches signature of std::swap().
Definition: PtrRef.h:66
Represents a source code location.
Definition: CodeLocation.h:23