diff options
author | jacobkeeler <jacob.keeler@livioradio.com> | 2019-04-29 17:24:27 -0400 |
---|---|---|
committer | jacobkeeler <jacob.keeler@livioradio.com> | 2019-04-29 17:24:27 -0400 |
commit | 09a161ba3e35c10b3f1b5d6c8a2d17943dbf516a (patch) | |
tree | 31d2069a22c9bd5d493498341f958d8d62228823 /src/components/formatters | |
parent | dc906fbd1b3609c049d96d82f443fb678dd84d6f (diff) | |
download | sdl_core-09a161ba3e35c10b3f1b5d6c8a2d17943dbf516a.tar.gz |
Run updated style script
Diffstat (limited to 'src/components/formatters')
19 files changed, 97 insertions, 99 deletions
diff --git a/src/components/formatters/include/formatters/CFormatterJsonBase.h b/src/components/formatters/include/formatters/CFormatterJsonBase.h index 66ffa0c1c5..b800ac1559 100644 --- a/src/components/formatters/include/formatters/CFormatterJsonBase.h +++ b/src/components/formatters/include/formatters/CFormatterJsonBase.h @@ -35,8 +35,8 @@ #ifndef SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_CFORMATTERJSONBASE_H_ #define SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_CFORMATTERJSONBASE_H_ -#include "smart_objects/smart_object.h" #include "json/json.h" +#include "smart_objects/smart_object.h" namespace ns_smart_device_link { namespace ns_json_handler { @@ -44,33 +44,33 @@ namespace formatters { namespace meta_formatter_error_code { /** - * @brief Error codes of MetaFormatter represented as bitmask - **/ + * @brief Error codes of MetaFormatter represented as bitmask + **/ typedef long tMetaFormatterErrorCode; /** - * @brief OK, no error - */ + * @brief OK, no error + */ static const tMetaFormatterErrorCode kErrorOk = 0x0; /** - * @brief origin smart object is not function - */ + * @brief origin smart object is not function + */ static const tMetaFormatterErrorCode kErrorObjectIsNotFunction = 0x01; /** - * @brief smart shema describes object which is not function - */ + * @brief smart shema describes object which is not function + */ static const tMetaFormatterErrorCode kErrorSchemaIsNotFunction = 0x02; /** - * @brief result smart object has invalid type (SmartType_Invalid) - * before passing to MetaFormatter, i.e. result object can not - * be changed, i.e. result object can not be built - * - */ + * @brief result smart object has invalid type (SmartType_Invalid) + * before passing to MetaFormatter, i.e. result object can not + * be changed, i.e. result object can not be built + * + */ static const tMetaFormatterErrorCode kErrorFailedCreateObjectBySchema = 0x04; -} +} // namespace meta_formatter_error_code /** * @brief The base class for all JSON based formatters. @@ -102,18 +102,18 @@ class CFormatterJsonBase { ns_smart_device_link::ns_smart_objects::SmartObject& obj); /** - * @brief The method constructs a JSON object from the input SmartObject - * - * @param obj Input SmartObject. Can contain a complex structure of objects. - * @param value The resulting JSON object. It has the same structure as the - *input SmartObject. - */ + * @brief The method constructs a JSON object from the input SmartObject + * + * @param obj Input SmartObject. Can contain a complex structure of objects. + * @param value The resulting JSON object. It has the same structure as the + *input SmartObject. + */ static void objToJsonValue( const ns_smart_device_link::ns_smart_objects::SmartObject& obj, Json::Value& value); }; -} -} -} // namespace ns_smart_device_link::ns_json_handler::formatters +} // namespace formatters +} // namespace ns_json_handler +} // namespace ns_smart_device_link #endif // SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_CFORMATTERJSONBASE_H_ diff --git a/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.h b/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.h index cd3e50212a..b1054100df 100644 --- a/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.h +++ b/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.h @@ -32,8 +32,8 @@ #include "json/json.h" -#include "smart_objects/smart_object.h" #include "smart_objects/enum_schema_item.h" +#include "smart_objects/smart_object.h" #include "CFormatterJsonBase.h" @@ -238,8 +238,8 @@ int32_t formatters::CFormatterJsonSDLRPCv1::fromString( return result; } -} -} -} // namespace ns_smart_device_link::ns_json_handler::formatters +} // namespace formatters +} // namespace ns_json_handler +} // namespace ns_smart_device_link #endif // SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_CFORMATTERJSONSDLRPCV1_H_ diff --git a/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv2.h b/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv2.h index f86e4e51cb..ab0289b293 100644 --- a/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv2.h +++ b/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv2.h @@ -188,8 +188,8 @@ inline bool CFormatterJsonSDLRPCv2::fromString( return result; } -} -} -} // namespace ns_smart_device_link::ns_json_handler::formatters +} // namespace formatters +} // namespace ns_json_handler +} // namespace ns_smart_device_link #endif // SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_CFORMATTERJSONSDLRPCV2_H_ diff --git a/src/components/formatters/include/formatters/CSmartFactory.h b/src/components/formatters/include/formatters/CSmartFactory.h index f3c3fbe207..c384dbf01d 100644 --- a/src/components/formatters/include/formatters/CSmartFactory.h +++ b/src/components/formatters/include/formatters/CSmartFactory.h @@ -35,10 +35,10 @@ #ifndef SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_CSMARTFACTORY_H_ #define SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_CSMARTFACTORY_H_ -#include "smart_objects/smart_object.h" -#include "smart_objects/smart_schema.h" #include <map> #include <string> +#include "smart_objects/smart_object.h" +#include "smart_objects/smart_schema.h" namespace ns_smart_device_link { namespace ns_json_handler { @@ -94,7 +94,7 @@ extern const std::string kCode; * @brief String constant for "message" param name. */ extern const std::string kMessage; -} +} // namespace strings /** * @brief Smart Schema key. @@ -286,11 +286,11 @@ bool CSmartFactory<FunctionIdEnum, MessageTypeEnum, StructIdEnum>::attachSchema( return false; MessageTypeEnum msgtype( - (MessageTypeEnum) - object[strings::S_PARAMS][strings::S_MESSAGE_TYPE].asInt()); + (MessageTypeEnum)object[strings::S_PARAMS][strings::S_MESSAGE_TYPE] + .asInt()); FunctionIdEnum fid( - (FunctionIdEnum) - object[strings::S_PARAMS][strings::S_FUNCTION_ID].asInt()); + (FunctionIdEnum)object[strings::S_PARAMS][strings::S_FUNCTION_ID] + .asInt()); SmartSchemaKey<FunctionIdEnum, MessageTypeEnum> key(fid, msgtype); @@ -415,6 +415,6 @@ bool operator<(const SmartSchemaKey<FunctionIdEnum, MessageTypeEnum>& l, return false; } -} -} +} // namespace ns_json_handler +} // namespace ns_smart_device_link #endif // SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_CSMARTFACTORY_H_ diff --git a/src/components/formatters/include/formatters/formatter_json_rpc.h b/src/components/formatters/include/formatters/formatter_json_rpc.h index 3503767988..593c837877 100644 --- a/src/components/formatters/include/formatters/formatter_json_rpc.h +++ b/src/components/formatters/include/formatters/formatter_json_rpc.h @@ -35,12 +35,12 @@ #ifndef SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_FORMATTER_JSON_RPC_H_ #define SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_FORMATTER_JSON_RPC_H_ -#include <string> #include <sys/stat.h> +#include <string> -#include "smart_objects/smart_object.h" -#include "smart_objects/enum_schema_item.h" #include "json/json.h" +#include "smart_objects/enum_schema_item.h" +#include "smart_objects/smart_object.h" #include "CFormatterJsonBase.h" #include "formatters/CSmartFactory.h" diff --git a/src/components/formatters/include/formatters/meta_formatter.h b/src/components/formatters/include/formatters/meta_formatter.h index 36e39301f6..b2ff546bfc 100644 --- a/src/components/formatters/include/formatters/meta_formatter.h +++ b/src/components/formatters/include/formatters/meta_formatter.h @@ -44,35 +44,35 @@ namespace ns_json_handler { namespace formatters { /** - * @brief Formats to string the smart object against given schema for given - *formatter - * - * Sample usage: - * CSmartFactory factory; - * SmartObject object; - * CSmartSchmema schema; - * - */ + * @brief Formats to string the smart object against given schema for given + *formatter + * + * Sample usage: + * CSmartFactory factory; + * SmartObject object; + * CSmartSchmema schema; + * + */ class CMetaFormatter { public: /** - * @brief Creates smart object by the given schema having copied - * matched tree elements from original object. - * - * @param object Original smart object which macthed tree elements - * will be copied from - * @param schema Smart schema which describes result smart object - * @param result_object createdsmart object - * @return true if successful, false - otherwise - */ + * @brief Creates smart object by the given schema having copied + * matched tree elements from original object. + * + * @param object Original smart object which macthed tree elements + * will be copied from + * @param schema Smart schema which describes result smart object + * @param result_object createdsmart object + * @return true if successful, false - otherwise + */ static bool CreateObjectByPattern( const ns_smart_device_link::ns_smart_objects::SmartObject& object, const ns_smart_device_link::ns_smart_objects::CSmartSchema& schema, ns_smart_device_link::ns_smart_objects::SmartObject& result_object); }; +} // namespace formatters +} // namespace ns_json_handler } // namespace ns_smart_device_link -} // namespace ns_smart_device_link::ns_json_handler -} // namespace ns_smart_device_link::ns_json_handler::formatters #endif // SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_META_FORMATTER_H_ diff --git a/src/components/formatters/src/CFormatterJsonBase.cc b/src/components/formatters/src/CFormatterJsonBase.cc index af8668543a..6dc3d28f16 100644 --- a/src/components/formatters/src/CFormatterJsonBase.cc +++ b/src/components/formatters/src/CFormatterJsonBase.cc @@ -31,8 +31,8 @@ // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. -#include "json/json.h" #include "formatters/CFormatterJsonBase.h" +#include "json/json.h" #include "utils/convert_utils.h" void ns_smart_device_link::ns_json_handler::formatters::CFormatterJsonBase:: diff --git a/src/components/formatters/src/CFormatterJsonSDLRPCv1.cc b/src/components/formatters/src/CFormatterJsonSDLRPCv1.cc index a5c3d1a103..2f47c83a6b 100644 --- a/src/components/formatters/src/CFormatterJsonSDLRPCv1.cc +++ b/src/components/formatters/src/CFormatterJsonSDLRPCv1.cc @@ -164,6 +164,6 @@ CFormatterJsonSDLRPCv1::MetaFormatToString( return result_code; } -} -} -} +} // namespace formatters +} // namespace ns_json_handler +} // namespace ns_smart_device_link diff --git a/src/components/formatters/src/CFormatterJsonSDLRPCv2.cc b/src/components/formatters/src/CFormatterJsonSDLRPCv2.cc index a582b52462..bee92fbbee 100644 --- a/src/components/formatters/src/CFormatterJsonSDLRPCv2.cc +++ b/src/components/formatters/src/CFormatterJsonSDLRPCv2.cc @@ -107,6 +107,6 @@ CFormatterJsonSDLRPCv2::MetaFormatToString( return result_code; } -} -} -} +} // namespace formatters +} // namespace ns_json_handler +} // namespace ns_smart_device_link diff --git a/src/components/formatters/test/CFormatterJsonBase_test.cc b/src/components/formatters/test/CFormatterJsonBase_test.cc index 1cd9c55bbc..91700b3f99 100644 --- a/src/components/formatters/test/CFormatterJsonBase_test.cc +++ b/src/components/formatters/test/CFormatterJsonBase_test.cc @@ -30,13 +30,13 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include <string> +#include "formatters/CFormatterJsonBase.h" #include <algorithm> -#include "json/value.h" +#include <string> +#include "formatters/generic_json_formatter.h" #include "gtest/gtest.h" #include "json/reader.h" -#include "formatters/CFormatterJsonBase.h" -#include "formatters/generic_json_formatter.h" +#include "json/value.h" namespace test { namespace components { diff --git a/src/components/formatters/test/CSmartFactory_test.cc b/src/components/formatters/test/CSmartFactory_test.cc index 3aba109e58..5bd212f431 100644 --- a/src/components/formatters/test/CSmartFactory_test.cc +++ b/src/components/formatters/test/CSmartFactory_test.cc @@ -30,8 +30,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "formatters/SmartFactoryTestHelper.h" #include "formatters/CSmartFactory.h" +#include "formatters/SmartFactoryTestHelper.h" #include "gtest/gtest.h" namespace test { diff --git a/src/components/formatters/test/cFormatterJsonSDLRPCv2_test.cc b/src/components/formatters/test/cFormatterJsonSDLRPCv2_test.cc index 628e9956bb..34cde397aa 100644 --- a/src/components/formatters/test/cFormatterJsonSDLRPCv2_test.cc +++ b/src/components/formatters/test/cFormatterJsonSDLRPCv2_test.cc @@ -30,9 +30,9 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "gtest/gtest.h" -#include "formatters/create_smartSchema.h" #include "formatters/CFormatterJsonSDLRPCv2.h" +#include "formatters/create_smartSchema.h" +#include "gtest/gtest.h" namespace test { namespace components { diff --git a/src/components/formatters/test/formatter_json_rpc_test.cc b/src/components/formatters/test/formatter_json_rpc_test.cc index f397accbd4..6e2e8753ca 100644 --- a/src/components/formatters/test/formatter_json_rpc_test.cc +++ b/src/components/formatters/test/formatter_json_rpc_test.cc @@ -30,18 +30,14 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include <algorithm> #include "formatters/formatter_json_rpc.h" -#include <string> -#include <set> -#include <algorithm> #include <json/writer.h> -#include "gtest/gtest.h" -#include "formatters/formatter_json_rpc.h" -#include <string> +#include <algorithm> #include <set> -#include "gtest/gtest.h" +#include <string> #include "formatters/CSmartFactory.h" +#include "formatters/formatter_json_rpc.h" +#include "gtest/gtest.h" #include "interfaces/HMI_API_schema.h" #include "interfaces/MOBILE_API_schema.h" diff --git a/src/components/formatters/test/generic_json_formatter_test.cc b/src/components/formatters/test/generic_json_formatter_test.cc index 97840eb110..39f0fd6e7e 100644 --- a/src/components/formatters/test/generic_json_formatter_test.cc +++ b/src/components/formatters/test/generic_json_formatter_test.cc @@ -30,8 +30,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "gtest/gtest.h" #include "formatters/generic_json_formatter.h" +#include "gtest/gtest.h" namespace test { namespace components { @@ -169,6 +169,6 @@ TEST(GenericJsonFormatter, FromString) { result.getElement("subobject").getElement("strField").asString().c_str()); } -} // formatters -} // components -} // test +} // namespace formatters +} // namespace components +} // namespace test diff --git a/src/components/formatters/test/include/formatters/SmartFactoryTestHelper.h b/src/components/formatters/test/include/formatters/SmartFactoryTestHelper.h index 4b1ca94b98..08962db120 100644 --- a/src/components/formatters/test/include/formatters/SmartFactoryTestHelper.h +++ b/src/components/formatters/test/include/formatters/SmartFactoryTestHelper.h @@ -38,15 +38,15 @@ #include "formatters/CSmartFactory.h" #include "interfaces/HMI_API_schema.h" -#include "smart_objects/always_true_schema_item.h" #include "smart_objects/always_false_schema_item.h" +#include "smart_objects/always_true_schema_item.h" #include "smart_objects/array_schema_item.h" #include "smart_objects/bool_schema_item.h" -#include "smart_objects/object_schema_item.h" -#include "smart_objects/string_schema_item.h" #include "smart_objects/enum_schema_item.h" #include "smart_objects/number_schema_item.h" +#include "smart_objects/object_schema_item.h" #include "smart_objects/schema_item_parameter.h" +#include "smart_objects/string_schema_item.h" namespace test { namespace components { @@ -107,7 +107,8 @@ class CSmartFactoryTest : public CSmartFactory<FunctionIdTest::eType, protected: typedef std::map<const StructIdentifiersTest::eType, - std::shared_ptr<ISchemaItem> > TStructsSchemaItems; + std::shared_ptr<ISchemaItem> > + TStructsSchemaItems; static std::shared_ptr<ISchemaItem> ProvideObjectSchemaItemForStruct( TStructsSchemaItems& struct_schema_items, diff --git a/src/components/formatters/test/include/formatters/create_smartSchema.h b/src/components/formatters/test/include/formatters/create_smartSchema.h index 73ff9ba77b..4fd0f200d3 100644 --- a/src/components/formatters/test/include/formatters/create_smartSchema.h +++ b/src/components/formatters/test/include/formatters/create_smartSchema.h @@ -33,8 +33,8 @@ #ifndef SRC_COMPONENTS_FORMATTERS_TEST_INCLUDE_FORMATTERS_CREATE_SMARTSCHEMA_H_ #define SRC_COMPONENTS_FORMATTERS_TEST_INCLUDE_FORMATTERS_CREATE_SMARTSCHEMA_H_ -#include "formatters/CFormatterJsonSDLRPCv1.h" #include "SmartFactoryTestHelper.h" +#include "formatters/CFormatterJsonSDLRPCv1.h" namespace test { namespace components { diff --git a/src/components/formatters/test/include/formatters/meta_formatter_test_helper.h b/src/components/formatters/test/include/formatters/meta_formatter_test_helper.h index 0ee21d092c..8a2b5abf0d 100644 --- a/src/components/formatters/test/include/formatters/meta_formatter_test_helper.h +++ b/src/components/formatters/test/include/formatters/meta_formatter_test_helper.h @@ -35,10 +35,10 @@ #include "gtest/gtest.h" -#include "smart_objects/smart_object.h" +#include "create_smartSchema.h" #include "formatters/CFormatterJsonSDLRPCv1.h" #include "formatters/CSmartFactory.h" -#include "create_smartSchema.h" +#include "smart_objects/smart_object.h" namespace test { namespace components { diff --git a/src/components/formatters/test/meta_formatter_test.cc b/src/components/formatters/test/meta_formatter_test.cc index 87f05ab50e..e405ff68eb 100644 --- a/src/components/formatters/test/meta_formatter_test.cc +++ b/src/components/formatters/test/meta_formatter_test.cc @@ -30,9 +30,9 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "gtest/gtest.h" #include "formatters/meta_formatter.h" #include "formatters/meta_formatter_test_helper.h" +#include "gtest/gtest.h" namespace test { namespace components { @@ -44,7 +44,8 @@ TEST_F(CMetaFormatterTestHelper, Json::Reader reader; CSmartFactory<FunctionIDTest::eType, MessageTypeTest::eType, - StructIdentifiers::eType> factory_; + StructIdentifiers::eType> + factory_; SmartObject object1 = factory_.CreateSmartObject( FunctionIDTest::RegisterAppInterface, MessageTypeTest::request); diff --git a/src/components/formatters/test/src/meta_formatter_test_helper.cc b/src/components/formatters/test/src/meta_formatter_test_helper.cc index b322510f6c..4f8975fe53 100644 --- a/src/components/formatters/test/src/meta_formatter_test_helper.cc +++ b/src/components/formatters/test/src/meta_formatter_test_helper.cc @@ -29,8 +29,8 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -#include "gtest/gtest.h" #include "formatters/meta_formatter_test_helper.h" +#include "gtest/gtest.h" namespace test { namespace components { |