Welcome to mirror list, hosted at ThFree Co, Russian Federation.

src_point.hpp « base - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2d46d0af56be727d79be9f249a7ca7aef066389e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#pragma once

#include <string>


#ifndef SRC_LOGGING
  #define SRC_LOGGING 1
#endif

#if SRC_LOGGING
  #ifndef __OBJC__
    #define SRC() my::SrcPoint(__FILE__, __LINE__, __FUNCTION__, "()")
  #else
    #define SRC() my::SrcPoint(__FILE__, __LINE__, __FUNCTION__)
  #endif
#else
  #define SRC() my::SrcPoint()
#endif

namespace my
{
  class SrcPoint
  {
  public:
    SrcPoint() : m_fileName(""), m_line(-1), m_function(""), m_postfix("")
    {
      TruncateFileName();
    }

    SrcPoint(char const * fileName, int line, char const * function, char const * postfix = "")
      : m_fileName(fileName), m_line(line), m_function(function), m_postfix(postfix)
    {
      TruncateFileName();
    }

    inline char const * FileName() const
    {
      return m_fileName;
    }

    inline int Line() const
    {
      return m_line;
    }

    inline char const * Function() const
    {
      return m_function;
    }

    inline char const * Postfix() const
    {
      return m_postfix;
    }

  private:
    void TruncateFileName();

    char const * m_fileName;
    int m_line;
    char const * m_function;
    char const * m_postfix;
  };
}

std::string DebugPrint(my::SrcPoint const & srcPoint);