fintp_base
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PlatformDeps.h
Go to the documentation of this file.
1 #ifndef PLATFORM_DEPS_H
2 #define PLATFORM_DEPS_H
3 
4 #if defined( __x86_64__ )
5  #define _64_BIT
6 #endif
7 
8 #include "DllMain.h"
9 #include <boost/cstdint.hpp>
10 #include <string>
11 using namespace std;
12 
13 namespace FinTP
14 {
17  {
18  public :
19 
20  // Path separator
21  static const string PATH_SEPARATOR;
22 
23  // Combines two paths( relative + relative or absolute + relative )
24  // <returns>The combine path</returns>
25  static string Combine( const string& path1, const string& path2 );
26 
27  // Finds the filename in the specified path
28  //<returns>The full filename( filename + extension )</returns>
29  static string GetFilename( const string& path );
30  };
31 
33  {
34  //private :
35  // Convert();
36 
37  public :
38 
39  #ifdef WIN32
40  static unsigned long ChangeEndian( const unsigned long value );
41  static long ChangeEndian( const long value );
42  #else
43  static unsigned long ChangeEndian( unsigned long value );
44  static long ChangeEndian( long value );
45  #endif
46 
47  #ifdef _64_BIT
48  static unsigned int ChangeEndian( unsigned int value );
49  static int ChangeEndian( int value );
50  #endif
51  };
52 
54  {
55  private :
56  Platform();
57 
58  static string m_MachineName;
59  static string m_MachineUID;
60  static boost::uint16_t m_MachineHash;
61  // Path separator
62  static const string NEWLINE_SEPARATOR;
63 
64  public :
65 
66  static string GetOSName();
67  static string GetMachineName();
68  static string GetIp( const string& name="" );
69  static string GetName( const string& ip="" );
70  static string GetUID();
71  static boost::uint16_t GetUIDHash();
72  static string getNewLineSeparator();
73  };
74 
76  {
77  private :
78  Process();
79 
80  public :
81  static long GetPID();
82  };
83 }
84 
85 #endif //PLATFORM_DEPS_H