-Documentation.
+# Documentation
-Generate documentation by executing command generate_documentation.sh from doc directory.
-Documentation will be generated in doc/html directory.
+Generate documentation by executing command generate_documentation.sh
+from doc directory. Documentation will be generated in doc/html directory.
There is also GUI tool named doxywizard.
+ cd ./doc
+ ./generate_documentation.sh
+
+
+# Code formatting
+
+We use astyle for code formatting.
+Get the latest version from http://sourceforge.net/projects/astyle/files/astyle/
+(at least v2.04). You can find the options file in the root of the project.
+For example to format all .cpp and .hpp files run in the project directory:
+
+ astyle --options=./astylerc --recursive ./*.cpp ./*.hpp
--- /dev/null
+style=stroustrup
+suffix=none
+indent=spaces=4
+indent-col1-comments
+min-conditional-indent=2
+max-instatement-indent=40
+pad-oper
+pad-header
+unpad-paren
+align-pointer=type
+align-reference=type
+add-brackets
+keep-one-line-statements
+convert-tabs
namespace security_containers {
-enum class ConfigProcessMode : int
-{
+enum class ConfigProcessMode : int {
Read,
Write
};
// use parsed object:
std::cout << config.bar;
*/
-class ConfigurationBase
-{
+class ConfigurationBase {
public:
virtual ~ConfigurationBase() {}
}
int len = json_object_array_length(array);
val.resize(len);
- for (int i = 0; i<len; ++i) {
+ for (int i = 0; i < len; ++i) {
val[i] = getValueFromJsonObj<T>(json_object_array_get_idx(array, i));
}
}
int len = json_object_array_length(obj);
val.resize(len);
- for (int i = 0; i<len; ++i) {
+ for (int i = 0; i < len; ++i) {
json_object* arrayObj = json_object_array_get_idx(obj, i);
val[i].process(arrayObj, ConfigProcessMode::Read);
}
namespace po = boost::program_options;
namespace {
- const std::string PROGRAM_NAME_AND_VERSION =
- "Security Containers Server " PROGRAM_VERSION;
+const std::string PROGRAM_NAME_AND_VERSION =
+ "Security Containers Server " PROGRAM_VERSION;
}
int main(int argc, char* argv[])
po::options_description desc("Allowed options");
desc.add_options()
- ("help,h", "print this help")
- ("version,v", "show application version")
+ ("help,h", "print this help")
+ ("version,v", "show application version")
;
po::variables_map vm;
if (!unrecognized_options.empty()) {
std::cout << "Unrecognized options: ";
- for (auto& uo: unrecognized_options) {
+ for (auto& uo : unrecognized_options) {
std::cout << ' ' << uo;
}
BOOST_AUTO_TEST_SUITE(ConfigSuite)
-struct TestConfig : public ConfigurationBase
-{
+struct TestConfig : public ConfigurationBase {
// subtree class
- struct SubConfig : public ConfigurationBase
- {
+ struct SubConfig : public ConfigurationBase {
int intVal;
- CONFIG_REGISTER
- {
+ CONFIG_REGISTER {
CONFIG_VALUE(intVal)
}
SubConfig subObj;
std::vector<SubConfig> subVector;
- CONFIG_REGISTER
- {
+ CONFIG_REGISTER {
CONFIG_VALUE(intVal)
CONFIG_VALUE(stringVal)
CONFIG_VALUE(floatVal)