diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-04-10 10:37:37 +0200 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-04-10 10:37:37 +0200 |
commit | 2d080a7fdfd2916e4723d19ba585a0f228118fb4 (patch) | |
tree | 1a4fbbe45dc6b83a44a1c827e13798dbcbcbe0fd /include | |
parent | 82ab3697a33e55591fe5b8c3c7fa8084424015f6 (diff) |
argument names are probably always hard coded strings, so no reason to copy them to std::string objects, and now we also fix a memory corruption issue (issue #75)
Diffstat (limited to 'include')
-rw-r--r-- | include/argument.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/include/argument.h b/include/argument.h index 81b1bf4..ddb6390 100644 --- a/include/argument.h +++ b/include/argument.h @@ -62,9 +62,9 @@ public: /** * Name of the argument - * @return std::string + * @return const char * */ - const std::string &name() const + const char *name() const { return _name; } @@ -80,9 +80,9 @@ public: /** * If the type is a class, the name of the class - * @return std::string + * @return const char * */ - const std::string &classname() const + const char *classname() const { return _classname; } @@ -108,39 +108,39 @@ public: private: /** * Name of the argument - * @var std::string + * @var const char * */ - std::string _name; + const char *_name = nullptr; /** * Type of argument * @var Type */ - Type _type; + Type _type = Type::Null; /** * Classname, if this is a parameter that is supposed to be an instance of a class * @var std::string */ - std::string _classname; + const char *_classname = nullptr; /** * May the parameter be null? * @var bool */ - bool _nullable; + bool _nullable = false; /** * Is this a required argument * @var bool */ - bool _required; + bool _required = true; /** * Is this a 'by-reference' parameter? * @var bool */ - bool _byReference; + bool _byReference = false; }; /** |