From deb41cf1ab203b3f57028d329b8865193a9bd813 Mon Sep 17 00:00:00 2001 From: Rico Antonio Felix Date: Tue, 23 Jun 2015 21:22:25 -0400 Subject: Enhanced documentation --- include/constant.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/constant.h b/include/constant.h index 0f2b354..4a120f4 100644 --- a/include/constant.h +++ b/include/constant.h @@ -1,12 +1,13 @@ /** - * Constant.h + * @file constant.h * * If you want to define global PHP constants, or class constants you can * use this constant class for it. Wrap the constant you'd like to create - * in a Php::Constant object and add it to the extension or the class: + * in a Php::Constant object and add it to the extension or the class. * - * extension.add(Php::Constant("CONSTANT_NAME", "value")); - * myclass.add(Php::Constant("CLASS_CONSTANT", "value")); + * Examples: + * extension.add(Php::Constant("CONSTANT_NAME", "value")); + * myclass.add(Php::Constant("CLASS_CONSTANT", "value")); * * @author Emiel Bruijntjes * @copyright 2015 Copernica BV -- cgit v1.2.3 From d7b6472ba9bc8da3cc77b0c2db7e5e94876fe28b Mon Sep 17 00:00:00 2001 From: Rico Antonio Felix Date: Tue, 23 Jun 2015 21:26:11 -0400 Subject: Added API documentation for Constant(const char*, bool) --- include/constant.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/constant.h b/include/constant.h index 4a120f4..5353bf4 100644 --- a/include/constant.h +++ b/include/constant.h @@ -36,6 +36,13 @@ public: * @param size Size of the value (in case of a string) */ Constant(const char *name, std::nullptr_t value = nullptr); + + /** + * Constructor to create a constant for a boolean value + * + * @param name Constant's name + * @param value Constant's value + */ Constant(const char *name, bool value); Constant(const char *name, int32_t value); Constant(const char *name, int64_t value); -- cgit v1.2.3 From a3688042d56e1de696faaab8f2c5df206d8d1411 Mon Sep 17 00:00:00 2001 From: Rico Antonio Felix Date: Tue, 23 Jun 2015 21:29:44 -0400 Subject: Added API documentation for Constant(const char*, int32_t) --- include/constant.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/constant.h b/include/constant.h index 5353bf4..b2e3d21 100644 --- a/include/constant.h +++ b/include/constant.h @@ -44,6 +44,13 @@ public: * @param value Constant's value */ Constant(const char *name, bool value); + + /** + * Constructor to create a constant for a 32-bit integer + * + * @param name Constant's name + * @param value Constant's value + */ Constant(const char *name, int32_t value); Constant(const char *name, int64_t value); Constant(const char *name, double value); -- cgit v1.2.3 From f06a841708b0de1fa30c6dc5bed5f19a9ec5548a Mon Sep 17 00:00:00 2001 From: Rico Antonio Felix Date: Tue, 23 Jun 2015 21:30:35 -0400 Subject: Added API documentation for Constant(const char*, int64_t) --- include/constant.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/constant.h b/include/constant.h index b2e3d21..6caaabf 100644 --- a/include/constant.h +++ b/include/constant.h @@ -52,6 +52,13 @@ public: * @param value Constant's value */ Constant(const char *name, int32_t value); + + /** + * Constructor to create a constant for a 64-bit integer + * + * @param name Constant's name + * @param value Constant's value + */ Constant(const char *name, int64_t value); Constant(const char *name, double value); Constant(const char *name, const char *value); -- cgit v1.2.3 From d0ca7090df5955a70243b952d76bcad28856dbba Mon Sep 17 00:00:00 2001 From: Rico Antonio Felix Date: Tue, 23 Jun 2015 21:32:11 -0400 Subject: Added API documentation for Constant(const char*, double) --- include/constant.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/constant.h b/include/constant.h index 6caaabf..d3b5749 100644 --- a/include/constant.h +++ b/include/constant.h @@ -60,6 +60,14 @@ public: * @param value Constant's value */ Constant(const char *name, int64_t value); + + /** + * Constructor to create a constant for a double precision + * floating point number + * + * @param name Constant's name + * @param value Constant's value + */ Constant(const char *name, double value); Constant(const char *name, const char *value); Constant(const char *name, const char *value, size_t size); -- cgit v1.2.3 From 4d21c60c95c8a21da0906d683cbd9098b1afb986 Mon Sep 17 00:00:00 2001 From: Rico Antonio Felix Date: Tue, 23 Jun 2015 21:37:41 -0400 Subject: Added API documentation for Constant(const char*, const char*) --- include/constant.h | 127 ++++++++++++++++++++++++++++------------------------- 1 file changed, 67 insertions(+), 60 deletions(-) diff --git a/include/constant.h b/include/constant.h index d3b5749..1f911c8 100644 --- a/include/constant.h +++ b/include/constant.h @@ -29,92 +29,99 @@ class ConstantImpl; class PHPCPP_EXPORT Constant { public: - /** - * Constructor - * @param name Constant name - * @param value Constant value - * @param size Size of the value (in case of a string) - */ - Constant(const char *name, std::nullptr_t value = nullptr); + /** + * Constructor + * @param name Constant name + * @param value Constant value + * @param size Size of the value (in case of a string) + */ + Constant(const char *name, std::nullptr_t value = nullptr); - /** - * Constructor to create a constant for a boolean value - * - * @param name Constant's name - * @param value Constant's value - */ - Constant(const char *name, bool value); + /** + * Constructor to create a constant for a boolean value + * + * @param name Constant's name + * @param value Constant's value + */ + Constant(const char *name, bool value); - /** + /** * Constructor to create a constant for a 32-bit integer * * @param name Constant's name * @param value Constant's value */ - Constant(const char *name, int32_t value); + Constant(const char *name, int32_t value); - /** + /** * Constructor to create a constant for a 64-bit integer * * @param name Constant's name * @param value Constant's value */ - Constant(const char *name, int64_t value); + Constant(const char *name, int64_t value); - /** + /** * Constructor to create a constant for a double precision * floating point number * * @param name Constant's name * @param value Constant's value */ - Constant(const char *name, double value); - Constant(const char *name, const char *value); - Constant(const char *name, const char *value, size_t size); - Constant(const char *name, const std::string &value); + Constant(const char *name, double value); - /** - * Destructor - */ - virtual ~Constant() {} + /** + * Constructor to create a constant for a string literal + * + * @param name Constant's name + * @param value Constant's value + */ + Constant(const char *name, const char *value); + Constant(const char *name, const char *value, size_t size); + Constant(const char *name, const std::string &value); - /** - * Add the constant to a class - * - * You normally do not have to call this method yourself. You can simply - * do one of the following method calls to create class constants: - * - * myclass.property("MY_CONSTANT", "value", Php::Const); - * myclass.constant("MY_CONSTANT", "value"); - * myclass.add(Php::Constant("MY_CONSTANT", "value")); - * - * All of the calls have the same result, it is up to you to decide which - * one suits you most. If you use the last one - using a Php::Constant - * class - the PHP-CPP library will call this "addTo()" method internally - * to forward the call to one of the other methods. - * - * @param clss Class to which the constant is added - * @internal - */ - void addTo(ClassBase &clss) const; + /** + * Destructor + */ + virtual ~Constant() {} + + /** + * Add the constant to a class + * + * You normally do not have to call this method yourself. You can simply + * do one of the following method calls to create class constants: + * + * myclass.property("MY_CONSTANT", "value", Php::Const); + * myclass.constant("MY_CONSTANT", "value"); + * myclass.add(Php::Constant("MY_CONSTANT", "value")); + * + * All of the calls have the same result, it is up to you to decide which + * one suits you most. If you use the last one - using a Php::Constant + * class - the PHP-CPP library will call this "addTo()" method internally + * to forward the call to one of the other methods. + * + * @param clss Class to which the constant is added + * @internal + */ + void addTo(ClassBase &clss) const; private: - /** - * Pointer to the actual implementation of the constant - * @var std::shared_ptr - */ - std::shared_ptr _impl; + /** + * Pointer to the actual implementation of the constant + * @var std::shared_ptr + */ + std::shared_ptr _impl; - /** - * Get access to the implementation object - * @return std::shared_ptr - */ - const std::shared_ptr &implementation() const { return _impl; } + /** + * Get access to the implementation object + * @return std::shared_ptr + */ + const std::shared_ptr &implementation() const {return _impl;} - /** - * The extension object has access to privates - */ - friend class ExtensionImpl; + /** + * The extension object has access to privates + */ + friend class ExtensionImpl; }; -- cgit v1.2.3 From 5754efa4b1b80f91b17c0ea1130de020ffb1b449 Mon Sep 17 00:00:00 2001 From: Rico Antonio Felix Date: Tue, 23 Jun 2015 21:41:38 -0400 Subject: Added API documentation for Constant(const char*, const char*, size_t) --- include/constant.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/constant.h b/include/constant.h index 1f911c8..a3a059f 100644 --- a/include/constant.h +++ b/include/constant.h @@ -77,6 +77,15 @@ public: * @param value Constant's value */ Constant(const char *name, const char *value); + + /** + * Constructor to create a constant for a string literal + * specifying the length of the string + * + * @param name Constant's name + * @param value Constant's value + * @param size Length of the string value + */ Constant(const char *name, const char *value, size_t size); Constant(const char *name, const std::string &value); -- cgit v1.2.3 From 1dd8cc398e82842b94508d943bf188a400ac31fb Mon Sep 17 00:00:00 2001 From: Rico Antonio Felix Date: Tue, 23 Jun 2015 21:43:34 -0400 Subject: Added API documentation for Constant(const char*, const std::string&) --- include/constant.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/constant.h b/include/constant.h index a3a059f..b578019 100644 --- a/include/constant.h +++ b/include/constant.h @@ -87,6 +87,14 @@ public: * @param size Length of the string value */ Constant(const char *name, const char *value, size_t size); + + /** + * Constructor to create a constant for a string literal + * using a std::string + * + * @param name Constant's name + * @param value Constant's value + */ Constant(const char *name, const std::string &value); /** -- cgit v1.2.3 From 45b3f8c27c32964c166200379ce5960cb59ec7d1 Mon Sep 17 00:00:00 2001 From: Rico Antonio Felix Date: Tue, 23 Jun 2015 21:48:22 -0400 Subject: Enhanced documentation for Constant(const char*, std::nullptr_t) --- include/constant.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/constant.h b/include/constant.h index b578019..9ff2882 100644 --- a/include/constant.h +++ b/include/constant.h @@ -30,10 +30,10 @@ class PHPCPP_EXPORT Constant { public: /** - * Constructor - * @param name Constant name - * @param value Constant value - * @param size Size of the value (in case of a string) + * Constructor to create a constant for a null value + * + * @param name Constant's name + * @param value Constant's value */ Constant(const char *name, std::nullptr_t value = nullptr); -- cgit v1.2.3 From 37cbc7cbf20837e3630d33bd9ce6498b2849514f Mon Sep 17 00:00:00 2001 From: Rico Antonio Felix Date: Tue, 23 Jun 2015 21:51:57 -0400 Subject: Refactored Constant::~Constant() to use C++ default keyword instead of an empty body to clarify intent --- include/constant.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/constant.h b/include/constant.h index 9ff2882..1326c5e 100644 --- a/include/constant.h +++ b/include/constant.h @@ -100,7 +100,7 @@ public: /** * Destructor */ - virtual ~Constant() {} + virtual ~Constant() = default; /** * Add the constant to a class -- cgit v1.2.3 From ca3f944f2c1aed9359ddc80e1c4d488a49433957 Mon Sep 17 00:00:00 2001 From: Rico Antonio Felix Date: Tue, 23 Jun 2015 21:54:57 -0400 Subject: Corrected API documentation for Constant::addTo(ClassBase&) const --- include/constant.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/constant.h b/include/constant.h index 1326c5e..faac3df 100644 --- a/include/constant.h +++ b/include/constant.h @@ -113,11 +113,11 @@ public: * myclass.add(Php::Constant("MY_CONSTANT", "value")); * * All of the calls have the same result, it is up to you to decide which - * one suits you most. If you use the last one - using a Php::Constant + * one suits you best. If you use the last one - using a Php::Constant * class - the PHP-CPP library will call this "addTo()" method internally * to forward the call to one of the other methods. * - * @param clss Class to which the constant is added + * @param clss Class to which the constant is added * @internal */ void addTo(ClassBase &clss) const; -- cgit v1.2.3 From f124eb439a29fce17336b0c279c25446d9eeafe1 Mon Sep 17 00:00:00 2001 From: Rico Antonio Felix Date: Tue, 23 Jun 2015 21:58:38 -0400 Subject: Corrected API documentation for std::shared_ptr Constant::_impl --- include/constant.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/constant.h b/include/constant.h index faac3df..571430b 100644 --- a/include/constant.h +++ b/include/constant.h @@ -125,7 +125,9 @@ public: private: /** * Pointer to the actual implementation of the constant - * @var std::shared_ptr + * + * @var std::shared_ptr Pointer to the constant implementation containing + * distributed ownership properties */ std::shared_ptr _impl; -- cgit v1.2.3 From b3959de86233d5bdefc700a77b1577de8c22c657 Mon Sep 17 00:00:00 2001 From: Rico Antonio Felix Date: Tue, 23 Jun 2015 22:01:17 -0400 Subject: Enhanced API documentation for Constant::implementation() const --- include/constant.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/constant.h b/include/constant.h index 571430b..1494cfb 100644 --- a/include/constant.h +++ b/include/constant.h @@ -133,7 +133,8 @@ private: /** * Get access to the implementation object - * @return std::shared_ptr + * + * @return std::shared_ptr Pointer to the constant implementation */ const std::shared_ptr &implementation() const {return _impl;} -- cgit v1.2.3 From 7280e6d9c6195ead445c114734e3dfc061f0a779 Mon Sep 17 00:00:00 2001 From: Rico Antonio Felix Date: Tue, 23 Jun 2015 22:02:15 -0400 Subject: Refactored Constant::implementation() const --- include/constant.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/constant.h b/include/constant.h index 1494cfb..d7540ef 100644 --- a/include/constant.h +++ b/include/constant.h @@ -136,7 +136,8 @@ private: * * @return std::shared_ptr Pointer to the constant implementation */ - const std::shared_ptr &implementation() const {return _impl;} + const std::shared_ptr &implementation() const + { return _impl; } /** * The extension object has access to privates -- cgit v1.2.3 From 0569a23f3b1def17e65a0395d09d8e2c31a71a3f Mon Sep 17 00:00:00 2001 From: Rico Antonio Felix Date: Tue, 23 Jun 2015 22:05:12 -0400 Subject: Tightened up file --- include/constant.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/constant.h b/include/constant.h index d7540ef..1397994 100644 --- a/include/constant.h +++ b/include/constant.h @@ -143,7 +143,6 @@ private: * The extension object has access to privates */ friend class ExtensionImpl; - }; /** -- cgit v1.2.3 From 7a12643e1b754970649e2f51ccfcbfe21d6dcd1a Mon Sep 17 00:00:00 2001 From: Rico Antonio Felix Date: Tue, 23 Jun 2015 23:50:02 -0400 Subject: Updated file description header --- include/classtype.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/classtype.h b/include/classtype.h index 9b6cc9e..5128353 100644 --- a/include/classtype.h +++ b/include/classtype.h @@ -1,5 +1,5 @@ /** - * ClassType.h + * @file classtype.h * * Internal class types enumeration. * -- cgit v1.2.3 From f9c1034c789d69a63e7e5ffc387cc776b0a3c2f0 Mon Sep 17 00:00:00 2001 From: Rico Antonio Felix Date: Tue, 23 Jun 2015 23:55:47 -0400 Subject: Adjusted the file description header --- include/argument.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/argument.h b/include/argument.h index 747f7a8..ab4faf7 100644 --- a/include/argument.h +++ b/include/argument.h @@ -1,5 +1,5 @@ /** - * Argument.h + * @file argument.h * * Class holds information about an argument that is passed to a function. * You'll need this class when you're defining your own functions. -- cgit v1.2.3 From 80dc8c465746f152b1654dc752ad0ba127c2b054 Mon Sep 17 00:00:00 2001 From: Rico Antonio Felix Date: Tue, 23 Jun 2015 23:56:57 -0400 Subject: Refactored Argument::~Argument() to use C++ default keyword instead of an empty body to clarify intent --- include/argument.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/argument.h b/include/argument.h index ab4faf7..f7fb782 100644 --- a/include/argument.h +++ b/include/argument.h @@ -25,7 +25,7 @@ public: /** * Destructor */ - virtual ~Argument() {} + virtual ~Argument() = default; protected: /** -- cgit v1.2.3