From 38e82e7a9de9d573e0a2c51f60610c241ef0d6bc Mon Sep 17 00:00:00 2001 From: "FeRD (Frank Dana)" Date: Sun, 4 Aug 2019 23:04:19 -0400 Subject: [PATCH] EffectBase/EffectInfo: std:: prefixes --- include/EffectBase.h | 14 ++++++-------- include/EffectInfo.h | 6 ++---- src/EffectBase.cpp | 6 +++--- src/EffectInfo.cpp | 4 ++-- 4 files changed, 13 insertions(+), 17 deletions(-) diff --git a/include/EffectBase.h b/include/EffectBase.h index a16b6620..8d0326c6 100644 --- a/include/EffectBase.h +++ b/include/EffectBase.h @@ -38,8 +38,6 @@ #include "Json.h" #include "Frame.h" -using namespace std; - namespace openshot { /** @@ -51,10 +49,10 @@ namespace openshot */ struct EffectInfoStruct { - string class_name; ///< The class name of the effect - string short_name; ///< A short name of the effect, commonly used for icon names, etc... - string name; ///< The name of the effect - string description; ///< The description of this effect and what it does + std::string class_name; ///< The class name of the effect + std::string short_name; ///< A short name of the effect, commonly used for icon names, etc... + std::string name; ///< The name of the effect + std::string description; ///< The description of this effect and what it does bool has_video; ///< Determines if this effect manipulates the image of a frame bool has_audio; ///< Determines if this effect manipulates the audio of a frame }; @@ -97,8 +95,8 @@ namespace openshot void InitEffectInfo(); /// Get and Set JSON methods - virtual string Json() = 0; ///< Generate JSON string of this object - virtual void SetJson(string value) = 0; ///< Load JSON string into this object + virtual std::string Json() = 0; ///< Generate JSON string of this object + virtual void SetJson(std::string value) = 0; ///< Load JSON string into this object virtual Json::Value JsonValue() = 0; ///< Generate Json::JsonValue for this object virtual void SetJsonValue(Json::Value root) = 0; ///< Load Json::JsonValue into this object Json::Value JsonInfo(); ///< Generate JSON object of meta data / info diff --git a/include/EffectInfo.h b/include/EffectInfo.h index 7806f096..1015b0da 100644 --- a/include/EffectInfo.h +++ b/include/EffectInfo.h @@ -34,8 +34,6 @@ #include "Effects.h" -using namespace std; - namespace openshot { @@ -49,10 +47,10 @@ namespace openshot { public: // Create an instance of an effect (factory style) - EffectBase* CreateEffect(string effect_type); + EffectBase* CreateEffect(std::string effect_type); /// JSON methods - static string Json(); ///< Generate JSON string of this object + static std::string Json(); ///< Generate JSON string of this object static Json::Value JsonValue(); ///< Generate Json::JsonValue for this object }; diff --git a/src/EffectBase.cpp b/src/EffectBase.cpp index 463a2c2c..caa5e722 100644 --- a/src/EffectBase.cpp +++ b/src/EffectBase.cpp @@ -74,7 +74,7 @@ int EffectBase::constrain(int color_value) } // Generate JSON string of this object -string EffectBase::Json() { +std::string EffectBase::Json() { // Return formatted string return JsonValue().toStyledString(); @@ -98,14 +98,14 @@ Json::Value EffectBase::JsonValue() { } // Load JSON string into this object -void EffectBase::SetJson(string value) { +void EffectBase::SetJson(std::string value) { // Parse JSON string into JSON objects Json::Value root; Json::CharReaderBuilder rbuilder; Json::CharReader* reader(rbuilder.newCharReader()); - string errors; + std::string errors; bool success = reader->parse( value.c_str(), value.c_str() + value.size(), &root, &errors ); delete reader; diff --git a/src/EffectInfo.cpp b/src/EffectInfo.cpp index 0b9c360d..8fb8a4fe 100644 --- a/src/EffectInfo.cpp +++ b/src/EffectInfo.cpp @@ -35,14 +35,14 @@ using namespace openshot; // Generate JSON string of this object -string EffectInfo::Json() { +std::string EffectInfo::Json() { // Return formatted string return JsonValue().toStyledString(); } // Create a new effect instance -EffectBase* EffectInfo::CreateEffect(string effect_type) { +EffectBase* EffectInfo::CreateEffect(std::string effect_type) { // Init the matching effect object if (effect_type == "Bars") return new Bars();