rename subkey to sub_key/sub-key v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Sun, 22 Nov 2020 19:22:25 +0100
branchv_0
changeset 5 d70ea23682aa
parent 4 d9b047731e18
child 6 fb717cfbfea1
rename subkey to sub_key/sub-key
bash-completion.sh
src/CLIParser.h
src/Configuration.h
src/INICommand.cpp
--- a/bash-completion.sh	Sun Nov 22 12:24:25 2020 +0100
+++ b/bash-completion.sh	Sun Nov 22 19:22:25 2020 +0100
@@ -29,7 +29,7 @@
 
 	if   [[ "$w1" == "--relation"                      && "x$w0" == "x" ]];    then COMPREPLY=("''")
 	elif [[ "$w1" == "--enable-sections"                                ]];    then COMPREPLY=($(compgen -W "${BOOLEAN_VALUES[*]}" -- "$w0"))
-	elif [[ "$w1" == "--enable-subkeys"                                 ]];    then COMPREPLY=($(compgen -W "${BOOLEAN_VALUES[*]}" -- "$w0"))
+	elif [[ "$w1" == "--enable-sub-keys"                                ]];    then COMPREPLY=($(compgen -W "${BOOLEAN_VALUES[*]}" -- "$w0"))
 	elif [[ "$w1" == "--enable-comments"                                ]];    then COMPREPLY=($(compgen -W "${BOOLEAN_VALUES[*]}" -- "$w0"))
 	elif [[ "$w1" == "--enable-line-numbers"                            ]];    then COMPREPLY=($(compgen -W "${BOOLEAN_VALUES[*]}" -- "$w0"))
 	elif [[ "$w1" == "--enable-event-numbers"                           ]];    then COMPREPLY=($(compgen -W "${BOOLEAN_VALUES[*]}" -- "$w0"))
@@ -37,7 +37,7 @@
 		OPTIONS=(
 			"--relation"
 			"--enable-sections"
-			"--enable-subkeys"
+			"--enable-sub-keys"
 			"--enable-comments"
 			"--enable-line-numbers"
 			"--enable-event-numbers"
--- a/src/CLIParser.h	Sun Nov 22 12:24:25 2020 +0100
+++ b/src/CLIParser.h	Sun Nov 22 19:22:25 2020 +0100
@@ -50,7 +50,7 @@
 
 	static const relpipe::writer::string_t OPTION_RELATION;
 	static const relpipe::writer::string_t OPTION_ENABLE_SECTIONS;
-	static const relpipe::writer::string_t OPTION_ENABLE_SUBKEYS;
+	static const relpipe::writer::string_t OPTION_ENABLE_SUB_KEYS;
 	static const relpipe::writer::string_t OPTION_ENABLE_COMMENTS;
 	static const relpipe::writer::string_t OPTION_ENABLE_LINE_NUMBERS;
 	static const relpipe::writer::string_t OPTION_ENABLE_EVENT_NUMBERS;
@@ -63,7 +63,7 @@
 
 			if (option == OPTION_RELATION) c.relation = readNext(arguments, i);
 			else if (option == OPTION_ENABLE_SECTIONS) c.enableSections = parseBoolean(readNext(arguments, i));
-			else if (option == OPTION_ENABLE_SUBKEYS) c.enableSubkeys = parseBoolean(readNext(arguments, i));
+			else if (option == OPTION_ENABLE_SUB_KEYS) c.enableSubKeys = parseBoolean(readNext(arguments, i));
 			else if (option == OPTION_ENABLE_COMMENTS) c.enableComments = parseBoolean(readNext(arguments, i));
 			else if (option == OPTION_ENABLE_LINE_NUMBERS) c.enableLineNumbers = parseBoolean(readNext(arguments, i));
 			else if (option == OPTION_ENABLE_EVENT_NUMBERS) c.enableEventNumbers = parseBoolean(readNext(arguments, i));
@@ -79,7 +79,7 @@
 
 const relpipe::writer::string_t CLIParser::OPTION_RELATION = L"--relation";
 const relpipe::writer::string_t CLIParser::OPTION_ENABLE_SECTIONS = L"--enable-sections";
-const relpipe::writer::string_t CLIParser::OPTION_ENABLE_SUBKEYS = L"--enable-subkeys";
+const relpipe::writer::string_t CLIParser::OPTION_ENABLE_SUB_KEYS = L"--enable-sub-keys";
 const relpipe::writer::string_t CLIParser::OPTION_ENABLE_COMMENTS = L"--enable-comments";
 const relpipe::writer::string_t CLIParser::OPTION_ENABLE_LINE_NUMBERS = L"--enable-line-numbers";
 const relpipe::writer::string_t CLIParser::OPTION_ENABLE_EVENT_NUMBERS = L"--enable-event-numbers";
--- a/src/Configuration.h	Sun Nov 22 12:24:25 2020 +0100
+++ b/src/Configuration.h	Sun Nov 22 19:22:25 2020 +0100
@@ -32,7 +32,7 @@
 	relpipe::writer::boolean_t enableLineNumbers = false;
 	relpipe::writer::boolean_t enableEventNumbers = false;
 	relpipe::writer::boolean_t enableSections = true;
-	relpipe::writer::boolean_t enableSubkeys = false;
+	relpipe::writer::boolean_t enableSubKeys = false;
 	relpipe::writer::boolean_t enableComments = false;
 
 	virtual ~Configuration() {
--- a/src/INICommand.cpp	Sun Nov 22 12:24:25 2020 +0100
+++ b/src/INICommand.cpp	Sun Nov 22 19:22:25 2020 +0100
@@ -70,7 +70,7 @@
 		if (configuration.enableEventNumbers) metadata.push_back({L"event", TypeId::INTEGER});
 		if (configuration.enableSections) metadata.push_back({L"section", TypeId::STRING});
 		metadata.push_back({L"key", TypeId::STRING});
-		if (configuration.enableSubkeys) metadata.push_back({L"subkey", TypeId::STRING});
+		if (configuration.enableSubKeys) metadata.push_back({L"sub_key", TypeId::STRING});
 		metadata.push_back({L"value", TypeId::STRING});
 		if (configuration.enableComments) metadata.push_back({L"comment", TypeId::STRING});
 		writer->startRelation(configuration.relation, metadata, true);
@@ -93,12 +93,12 @@
 		if (configuration.enableEventNumbers) writer->writeAttribute(&event.eventNumber, typeid (event.eventNumber));
 
 		std::string section = getCurrentSectionFullName();
-		std::string key = configuration.enableSubkeys ? event.key : event.fullKey;
+		std::string key = configuration.enableSubKeys ? event.key : event.fullKey;
 
 		if (configuration.enableSections) writer->writeAttribute(convertor.from_bytes(section));
 		else if (section.size()) key = section + "/" + key;
 		writer->writeAttribute(convertor.from_bytes(key));
-		if (configuration.enableSubkeys) writer->writeAttribute(convertor.from_bytes(event.subKey));
+		if (configuration.enableSubKeys) writer->writeAttribute(convertor.from_bytes(event.subKey));
 
 		writer->writeAttribute(convertor.from_bytes(event.value));
 		if (configuration.enableComments) writer->writeAttribute(convertor.from_bytes(event.comment));