diff --git a/Doxyfile b/Doxyfile index 0dc0d78..e330588 100644 --- a/Doxyfile +++ b/Doxyfile @@ -297,7 +297,7 @@ ALIASES = # members will be omitted, etc. # The default value is: NO. -OPTIMIZE_OUTPUT_FOR_C = YES +OPTIMIZE_OUTPUT_FOR_C = NO # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or # Python sources only. Doxygen will then generate output that is more tailored @@ -891,7 +891,7 @@ WARN_NO_PARAMDOC = NO # will automatically be disabled. # The default value is: NO. -WARN_IF_UNDOC_ENUM_VAL = NO +WARN_IF_UNDOC_ENUM_VAL = YES # If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when # a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS @@ -1996,7 +1996,7 @@ EXTRA_SEARCH_MAPPINGS = # If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output. # The default value is: YES. -GENERATE_LATEX = YES +GENERATE_LATEX = NO # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of diff --git a/include/filesystem/fileaction.h b/include/filesystem/fileaction.h index 0a6375d..ce92399 100644 --- a/include/filesystem/fileaction.h +++ b/include/filesystem/fileaction.h @@ -30,10 +30,10 @@ namespace Nickvision::Filesystem */ enum class FileAction { - Added = 1, - Removed, - Modified, - Renamed + Added = 1, ///< A file was added to the file system object. + Removed, ///< A file was removed from the file system object. + Modified, ///< A file was modified in the file system object. + Renamed ///< A file was renamed in the file system object. }; } diff --git a/include/filesystem/userdirectory.h b/include/filesystem/userdirectory.h index ef11a23..add08df 100644 --- a/include/filesystem/userdirectory.h +++ b/include/filesystem/userdirectory.h @@ -30,20 +30,20 @@ namespace Nickvision::Filesystem */ enum class UserDirectory { - Home, - Config, - ApplicationConfig, - Cache, - ApplicationCache, - LocalData, - ApplicationLocalData, - Desktop, - Documents, - Downloads, - Music, - Pictures, - Templates, - Videos + Home, ///< The home directory. + Config, ///< The configuration directory. + ApplicationConfig, ///< The application configuration directory. + Cache, ///< The cache directory. + ApplicationCache, ///< The application cache directory. + LocalData, ///< The local data directory. + ApplicationLocalData, ///< The application local data directory. + Desktop, ///< The desktop directory. + Documents, ///< The documents directory. + Downloads, ///< The downloads directory. + Music, ///< The music directory. + Pictures, ///< The pictures directory. + Templates, ///< The templates directory. + Videos ///< The videos directory. }; } diff --git a/include/filesystem/watcherflags.h b/include/filesystem/watcherflags.h index 93ce453..4797555 100644 --- a/include/filesystem/watcherflags.h +++ b/include/filesystem/watcherflags.h @@ -30,12 +30,12 @@ namespace Nickvision::Filesystem */ enum class WatcherFlags { - FileName = 1, - DirectoryName = 2, - Attributes = 4, - Size = 8, - LastWrite = 16, - LastAccess = 32 + FileName = 1, ///< The name of a file in the file system object has changed. + DirectoryName = 2, ///< The name of a directory in the file system object has changed. + Attributes = 4, ///< The attributes of an item in the file system object have changed. + Size = 8, ///< The size of an item in the file system object has changed. + LastWrite = 16, ///< The last write time of an item in the file system object has changed. + LastAccess = 32 ///< The last access time of an item in the file system object has changed. }; constexpr WatcherFlags operator~(WatcherFlags a) diff --git a/include/keyring/credentialcheckstatus.h b/include/keyring/credentialcheckstatus.h index 32c1dab..49bbcc3 100644 --- a/include/keyring/credentialcheckstatus.h +++ b/include/keyring/credentialcheckstatus.h @@ -30,10 +30,10 @@ namespace Nickvision::Keyring */ enum class CredentialCheckStatus { - Valid = 1, - EmptyName = 2, - EmptyUsernamePassword = 4, - InvalidUri = 8 + Valid = 1, ///< The credential is valid. + EmptyName = 2, ///< The credential has an empty name. + EmptyUsernamePassword = 4, ///< The credential has an empty username or password. + InvalidUri = 8 ///< The credential has an invalid URI. }; constexpr CredentialCheckStatus operator~(CredentialCheckStatus a) diff --git a/include/keyring/passwordcontent.h b/include/keyring/passwordcontent.h index 47f5c9a..78c6c9e 100644 --- a/include/keyring/passwordcontent.h +++ b/include/keyring/passwordcontent.h @@ -30,10 +30,10 @@ namespace Nickvision::Keyring */ enum class PasswordContent { - Numeric = 1, - Uppercase = 2, - Lowercase = 4, - Special = 8 + Numeric = 1, ///< The password contains numeric characters. + Uppercase = 2, ///< The password contains uppercase characters. + Lowercase = 4, ///< The password contains lowercase characters. + Special = 8 ///< The password contains special characters. }; constexpr PasswordContent operator~(PasswordContent a) diff --git a/include/keyring/passwordstrength.h b/include/keyring/passwordstrength.h index a37f31d..fc70b3a 100644 --- a/include/keyring/passwordstrength.h +++ b/include/keyring/passwordstrength.h @@ -32,12 +32,12 @@ namespace Nickvision::Keyring */ enum class PasswordStrength { - Blank = 0, - VeryWeak, - Weak, - Medium, - Strong, - VeryStrong + Blank = 0, ///< A blank password. + VeryWeak, ///< A very weak password. + Weak, ///< A weak password. + Medium, ///< A medium password. + Strong, ///< A strong password. + VeryStrong ///< A very strong password. }; /** diff --git a/include/logging/loglevel.h b/include/logging/loglevel.h index 072432d..f6f9f1d 100644 --- a/include/logging/loglevel.h +++ b/include/logging/loglevel.h @@ -30,11 +30,11 @@ namespace Nickvision::Logging */ enum class LogLevel { - Debug, - Info, - Warning, - Error, - Critical + Debug, ///< A debug message. + Info, ///< An informational message. + Warning, ///< A warning message. + Error, ///< An error message. + Critical // /& saved() - { - return m_saved; - } - - bool save() - { - ... - saved({}); //Same as saved.invoke({}); - ... - } - -private: - ... - Events::Event m_saved; -}; + class DataFileBase + { + public: + ... + Events::Event& saved() + { + return m_saved; + } + + bool save() + { + ... + saved({}); //Same as saved.invoke({}); + ... + } + + private: + ... + Events::Event m_saved; + }; +} ``` -Here we can see how `ConfigurationBase` defines a `saved` event, exposes it to the consumer, and triggers/invokes the event within its `save` method. +Here we can see how `Nickvision::App::DataFileBase` defines a `saved` event, exposes it to the consumer, and triggers/invokes the event within its `save` method. -A consumer of `ConfigurationBase` can easily subscribe to the event and have its handler called when the configuration object is saved: +A consumer of `Nickvision::App::DataFileBase` can easily subscribe to the event and have its handler called when the configuration object is saved: ```cpp -void handler(const Nickvision::Events::EventArgs& e) +using namespace Nickvision::App; +using namespace Nickvision::Events; + +void handler(const EventArgs& e) { std::cout << "Config saved." << std::endl; } int main() { - ConfigurationBase base{ ... }; + DataFileBase base{ ... }; base.saved() += handler; base.save(); } ``` -This program will print "Config saved." as a result of the event being invoke once the save method was called. \ No newline at end of file +This program will print `Config saved.` as a result of the event being invoke once the save method was called. \ No newline at end of file diff --git a/manual/ipc.md b/manual/ipc.md index 266433c..9e3074a 100644 --- a/manual/ipc.md +++ b/manual/ipc.md @@ -1,15 +1,16 @@ # Performing Inter-Process Communication -libnick uses named-pipes on Windows and Unix Domain Sockets on Linux to establish inter process server and client communicators, while abstracting all of that away from the consumer in the easy to use `InterProcessCommunicator` API. +libnick uses named-pipes on Windows and Unix Domain Sockets on Linux and macOS to establish inter process server and client communicators, while abstracting all of that away from the consumer in the easy to use `Nickvision::App::InterProcessCommunicator` API. -Upon creating an `InterProcessCommunicator` object, either `isServer()` or `isClient()` will return true depending on whether or not this instance is a server or client respectively. Server instances should register a callback to the `CommandReceived` event to be invoked when clients send commands to the server. +Upon creating an `Nickvision::App::InterProcessCommunicator` object, either `isServer()` or `isClient()` will return true depending on whether or not this instance is a server or client respectively. Server instances should register a callback to the `CommandReceived` event to be invoked when clients send commands to the server. -NOTE: Whether or not `InterProcessCommunicator` is a client or server, its object should be kept alive for the entire running of an application to avoid accidentally removing a process as the server instance if the object is destroyed midway of an application running. +NOTE: Server instance of `Nickvision::App::InterProcessCommunicator` should be kept alive for the entire need for the communicator. This includes when the need to receive client messages is present. -Let's consider an example scenario for using the `InterProcessCommunicator`. Assume we have an application where we want the first instance to be considered the main, running instance. Assume that if other instances of said application are started, we want its arguments to be passed to the main instance and then have said other instances be closed. This will allow, for example, a GUI main instance to be manipulated via secondary CLI instances. +Let's consider an example scenario for using the `Nickvision::App::InterProcessCommunicator`. Assume we have an application where we want the first instance to be considered the main, running instance. Assume that if other instances of said application are started, we want its arguments to be passed to the main instance and then have said other instances be closed. This will allow, for example, a GUI main instance to be manipulated via secondary CLI instances. Here's the code for this: ```cpp using namespace Nickvision::App; +using namespace Nickvision::Events; int main(int argc, char*[] argv) { @@ -22,10 +23,15 @@ int main(int argc, char*[] argv) } } InterProcessCommunicator& ipc{ "appid" }; - ipc.commandReceived() += [](const Events::ParamEventArgs>& args) { ... }; + ipc.commandReceived() += handleArguments; ipc.communicate(modernArgs, true); } + +void handleArguments(const ParamEventArgs>& args) +{ + ... +} ``` -If this program is ran for the first time, ipc will be the server instance. `handleArguments` will be invoked after `communicate` with its own arguments, as `communicate` still invokes `CommandReceived` even if ipc is the server instance. +If this program is ran for the first time, `ipc` will be the server instance. The `handleArguments` function will be invoked after `communicate` with its own arguments, as `communicate` still invokes `CommandReceived` even if ipc is the server instance. -If this program is ran not for the first time, its arguments will be sent to the first instance and this instance itself will close. The first instance's `handleArguments` function will be called as a result of `CommandReceived` being invoked by the ipc server receiving the command. \ No newline at end of file +If this program is ran *not* for the first time, its arguments will be sent to the first instance and this instance itself will close (as `true` was passed as the second argument of `communicate`). The first instance's `handleArguments` function will be called as a result of `CommandReceived` being invoked by the ipc server receiving the command. \ No newline at end of file diff --git a/manual/netmonitor.md b/manual/netmonitor.md index c98f812..63cbe21 100644 --- a/manual/netmonitor.md +++ b/manual/netmonitor.md @@ -1,8 +1,10 @@ # Monitoring Network Connectivity -The `NetworkMonitor` provides an easy to use API to monitor for changes in the system's network connectivity. +The `Nickvision::Network::NetworkMonitor` class provides an easy to use API to monitor for changes in the system's network connectivity. Take the following program that checks the network status on startup and watches for changes: ```cpp +using namespace Nickvision::Network; + void onNetChanged(const NetworkStateChangedEventArgs& e) { std::cout << "Network state changed: " << (int)e.getState() << std::endl; diff --git a/manual/notifyicon.md b/manual/notifyicon.md index fd8f835..e6d8a52 100644 --- a/manual/notifyicon.md +++ b/manual/notifyicon.md @@ -1,5 +1,5 @@ # Creating a Context Menu -The `NotifyMenuItem` provides an easy API for creating context menus for a `NotifyIcon` to use within your app. +The `Nickvision::Notifications::NotifyMenuItem` class provides an easy API for creating context menus for a `Nickvision::Notifications::NotifyIcon` to use within your Windows app. Assume we want to create the following context menu for a `NotifyIcon`: ``` @@ -12,6 +12,8 @@ Assume we want to create the following context menu for a `NotifyIcon`: Here is the code we could use to accomplish this: ```cpp +using namespace Nickvision::Notifications; + ... bool m_running{ true }; NotifyIconMenu contextMenu;