11#ifndef _CONFIGURATION_H
22#define _CONFIGURATION_H
33
4- #include < string.h >
5- #include < stdint.h >
4+ #include < cstring >
5+ #include < cstdint >
66#include < boost/algorithm/string/replace.hpp>
77
88#if defined(__linux__)
1414#endif
1515
1616
17- #include " Exception.h "
18- #include " XMLReader.h "
19- #include " board/logger.h "
17+ #include " Exception.hpp "
18+ #include " XMLReader.hpp "
19+ #include " board/logger.hpp "
2020
2121namespace chesspp
2222{
@@ -26,7 +26,7 @@ namespace chesspp
2626 {
2727 protected:
2828 std::string res_path;
29-
29+
3030 // Linux and Windows, resource path is defined as the absolute path the folder where the application executable is stored.
3131 // <exe_location>/res/img/... should be where resources are stored.
3232 // OS x, resource path is defined as the absolute path to the Resources folder of the .app structure.
@@ -49,7 +49,7 @@ namespace chesspp
4949 ret = buf;
5050 boost::replace_all (ret, " \\ " , " /" );
5151 ret = ret.substr (0 , ret.find_last_of (' /' )+1 );
52-
52+
5353 #elif defined(__APPLE__)
5454 if (_NSGetExecutablePath (buf, &size) != 0 )
5555 throw chesspp::exception (" Unable to determine executable path on OS x. (Buffer size too small?)" );
@@ -60,7 +60,7 @@ namespace chesspp
6060
6161 #else
6262 throw chesspp::exception (" Unknown OS. Unable to determine executable path." );
63- #endif
63+ #endif
6464
6565 return ret;
6666 }
@@ -69,7 +69,7 @@ namespace chesspp
6969 public:
7070 configuration (const std::string &configFile) : res_path(getResourcePath()), reader(getResourcePath() + configFile) {}
7171 virtual ~configuration () {}
72-
72+
7373 };
7474
7575 class BoardConfig : public configuration
@@ -79,15 +79,15 @@ namespace chesspp
7979 uint16_t cell_width, cell_height;
8080
8181 public:
82- BoardConfig () : configuration(" config.xml" )
82+ BoardConfig () : configuration(" config.xml" )
8383 {
8484 initial_layout = res_path + reader.getProperty <std::string>(" chesspp.data.board.initial_layout" );
8585 board_width = reader.getProperty <uint8_t >(" chesspp.data.board.width" );
8686 board_height = reader.getProperty <uint8_t >(" chesspp.data.board.height" );
8787 cell_width = reader.getProperty <uint16_t >(" chesspp.data.board.cell_width" );
8888 cell_height = reader.getProperty <uint16_t >(" chesspp.data.board.cell_height" );
8989 }
90-
90+
9191 std::string getInitialLayout () { return initial_layout; }
9292 uint8_t getBoardWidth () { return board_width; }
9393 uint8_t getBoardHeight () { return board_height; }
@@ -111,7 +111,7 @@ namespace chesspp
111111 std::string getSpritePath_pieces () { return path_pieces; }
112112 std::string getSpritePath_validMove () { return path_validMove; }
113113 };
114- }
114+ }
115115}
116116
117- #endif
117+ #endif
0 commit comments