Just create a normal header file and include it in every file where you need that global variables. (Using namespaces is also a good choice to group your variables!)
#ifndef ARTISTICSTYLECONSTANTS_H
#define ARTISTICSTYLECONSTANTS_H
namespace ArtisticStyle
{
namespace Constants
{
// Predefined Style Options
const char* const ASP_STYLE = "style";
const int ASP_STYLE_DEF = -1;
// Tab and Bracket Options
const char* const ASP_INDENT = "indent";
const bool ASP_INDENT_DEF = true;
const char* const ASP_INDENTSTYLE = "indentStyle";
const char* const ASP_INDENTSTYLE_DEF = "spaces";
const char* const ASP_INDENTSIZE = "indentSize";
const int ASP_INDENTSIZE_DEF = 2;
const char* const ASP_BRACKETS = "brackets";
const bool ASP_BRACKETS_DEF = true;
const char* const ASP_BRACKETSSTYLE = "bracketsStyle";
const int ASP_BRACKETSSTYLE_DEF = astyle::BREAK_MODE;
// [...]
}
}
#endif // ARTISTICSTYLECONSTANTS_H
#ifndef ARTISTICSTYLECONSTANTS_H
#define ARTISTICSTYLECONSTANTS_H
namespace ArtisticStyle
{
namespace Constants
{
// Predefined Style Options
const char* const ASP_STYLE = "style";
const int ASP_STYLE_DEF = -1;
// Tab and Bracket Options
const char* const ASP_INDENT = "indent";
const bool ASP_INDENT_DEF = true;
const char* const ASP_INDENTSTYLE = "indentStyle";
const char* const ASP_INDENTSTYLE_DEF = "spaces";
const char* const ASP_INDENTSIZE = "indentSize";
const int ASP_INDENTSIZE_DEF = 2;
const char* const ASP_BRACKETS = "brackets";
const bool ASP_BRACKETS_DEF = true;
const char* const ASP_BRACKETSSTYLE = "bracketsStyle";
const int ASP_BRACKETSSTYLE_DEF = astyle::BREAK_MODE;
// [...]
}
}
#endif // ARTISTICSTYLECONSTANTS_H
To copy to clipboard, switch view to plain text mode
Bookmarks