Skip to content

Commit 906b4f0

Browse files
authored
Review/modify/add the API doc (utils folder) (#1182)
In `olp-cpp-sdk-core/include/Utils`, review and modify the existing documentation and add missing descriptions so that we have fewer errors when building the API ref. Relates-To: OLPEDGE-1450 Signed-off-by: Halyna Dumych <[email protected]>
1 parent e132523 commit 906b4f0

File tree

6 files changed

+317
-169
lines changed

6 files changed

+317
-169
lines changed

olp-cpp-sdk-core/include/olp/core/utils/Base64.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,42 +30,42 @@ namespace olp {
3030
namespace utils {
3131

3232
/**
33-
* @brief Encodes binary stream into base64 text.
33+
* @brief Encodes a binary stream into a Base64 text.
3434
*
35-
* @param bytes Data to be encoded.
35+
* @param bytes The data to be encoded.
3636
*
37-
* @return Base64 encoded string.
37+
* @return The Base64 encoded string.
3838
*/
3939
CORE_API std::string Base64Encode(const std::vector<std::uint8_t>& bytes);
4040

4141
/**
42-
* @brief Encodes binary stream into base64 text.
42+
* @brief Encodes a string into a Base64 text.
4343
*
44-
* @param bytes Data to be encoded.
44+
* @param bytes The data to be encoded.
4545
*
46-
* @return Base64 encoded string.
46+
* @return The Base64 encoded string.
4747
*/
4848
CORE_API std::string Base64Encode(const std::string& bytes);
4949

5050
/**
51-
* @brief Encodes binary stream into base64 text.
51+
* @brief Encodes a binary stream into a Base64 text.
5252
*
53-
* @param bytes Data to be encoded.
54-
* @param size The length of the bytes array.
53+
* @param bytes The data to be encoded.
54+
* @param size The length of the byte array.
5555
*
56-
* @return Base64 encoded string.
56+
* @return The Base64 encoded string.
5757
*/
5858
CORE_API std::string Base64Encode(const void* bytes, size_t size);
5959

6060
/**
61-
* @brief Decodes base64 into a binary stream.
61+
* @brief Decodes a Base64 string into a binary stream.
6262
*
63-
* @param[in] string Base64 string to be decoded.
64-
* @param[out] bytes Vector containing decoded bytes.
65-
* @param[in] write_null_bytes True if decoded null bytes should be written to
66-
* the output, false otherwise. Default is true.
63+
* @param[in] string The Base64 string to be decoded.
64+
* @param[out] bytes The vector containing the decoded bytes.
65+
* @param[in] write_null_bytes True if the decoded NULL bytes should be written to
66+
* the output; false otherwise. The default value is true.
6767
*
68-
* @return \c true if decoding was successful, \c false otherwise.
68+
* @return True if the decoding was successful; false otherwise.
6969
*/
7070
CORE_API bool Base64Decode(const std::string& string,
7171
std::vector<std::uint8_t>& bytes,

olp-cpp-sdk-core/include/olp/core/utils/Config.h

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,19 @@
2020
#pragma once
2121

2222
/**
23-
* @file
24-
* Contains macros to determine the compile-time configuration.
23+
* @file Config.h
24+
* @brief Contains macros that determine the compile-time configuration.
2525
*/
2626

27-
/**
28-
* Defined to 1 if exceptions are enabled, 0 if disabled.
29-
*/
27+
/// Set to 1 if the exceptions are enabled; 0 if disabled.
3028
#define CORE_EXCEPTIONS_ENABLED 0
3129

3230
#if defined(__EXCEPTIONS) || defined(_CPPUNWIND) || defined(__CPPUNWIND)
3331
#undef CORE_EXCEPTIONS_ENABLED
3432
#define CORE_EXCEPTIONS_ENABLED 1
3533
#endif
3634

37-
/**
38-
* Defined to 1 if C++ RTTI is enabled, 0 if disabled.
39-
*/
35+
/// Set to 1 if C++ RTTI is enabled; 0 if disabled.
4036
#define CORE_RTTI_ENABLED 0
4137

4238
#if defined(__GNUC__)

olp-cpp-sdk-core/include/olp/core/utils/Dir.h

Lines changed: 38 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -27,97 +27,101 @@
2727
namespace olp {
2828
namespace utils {
2929

30+
/** @brief Manages directories.
31+
*/
3032
class CORE_API Dir {
3133
public:
32-
/// Alias for filter function.
34+
/// An alias for the filter function.
3335
using FilterFunction = std::function<bool(const std::string&)>;
3436

3537
/**
36-
* @brief Checks if directory exists.
38+
* @brief Checks whether a directory exists.
3739
*
38-
* @param path Path of the directory.
40+
* @param path The path of the directory.
3941
*
40-
* @return \c true if directory exists, \c false otherwise.
42+
* @return True if the directory exists; false otherwise.
4143
*
42-
* @deprecated Will be removed by 10.2020. Please use Exists() instead.
44+
* @deprecated Will be removed by 10/2020. Use `Exists()` instead.
4345
*/
4446
static bool exists(const std::string& path);
4547

4648
/**
47-
* @brief Checks if directory exists.
49+
* @brief Checks whether a directory exists.
4850
*
49-
* @param path Path of the directory.
51+
* @param path The path of the directory.
5052
*
51-
* @return true if directory exists, false otherwise.
53+
* @return True if the directory exists; false otherwise.
5254
*/
5355
static bool Exists(const std::string& path);
5456

5557
/**
56-
* @brief Removes the directory, deleting all subfolders and files.
58+
* @brief Removes a directory and deletes all its subfolders and files.
5759
*
58-
* @param path Path of the directory.
60+
* @param path The path of the directory.
5961
*
60-
* @return true if operation is successfull, false otherwise.
62+
* @return True if the operation is successful; false otherwise.
6163
*
62-
* @deprecated Will be removed by 10.2020. Please use Remove() instead.
64+
* @deprecated Will be removed by 10/2020. Use `Remove()` instead.
6365
*/
6466
static bool remove(const std::string& path);
6567

6668
/**
67-
* @brief Removes the directory, deleting all subfolders and files.
69+
* @brief Removes a directory and deletes all its subfolders and files.
6870
*
69-
* @param path Path of the directory.
71+
* @param path The path of the directory.
7072
*
71-
* @return \c true if operation is successfull, \c false otherwise.
73+
* @return True if the operation is successful; false otherwise.
7274
*/
7375
static bool Remove(const std::string& path);
7476

7577
/**
76-
* @brief Creates the directory including all required directories on
77-
* the path.
78+
* @brief Creates a directory and all required directories specified
79+
* in the path.
7880
*
79-
* @param path Path of the directory.
81+
* @param path The path of the directory.
8082
*
81-
* @return \c true if operation is successfull, \c false otherwise.
83+
* @return True if the operation is successful; false otherwise.
8284
*
83-
* @deprecated Will be removed by 10.2020. Please use Create() instead.
85+
* @deprecated Will be removed by 10/2020. Use `Create()` instead.
8486
*/
8587
static bool create(const std::string& path);
8688

8789
/**
88-
* @brief Creates the directory including all required directories on
89-
* the path.
90+
* @brief Creates a directory and all required directories specified
91+
* in the path.
9092
*
91-
* @param path Path of the directory.
93+
* @param path The path of the directory.
9294
*
93-
* @return \c true if operation is successfull, \c false otherwise.
95+
* @return True if the operation is successful; false otherwise.
9496
*/
9597
static bool Create(const std::string& path);
9698

9799
/**
98-
* @brief Returns the platform-specific temporary path.
100+
* @brief Gets a platform-specific temporary path.
99101
*
100-
* @return The platform specific temporary directory path.
102+
* @return The platform-specific temporary path of the directory.
101103
*/
102104
static std::string TempDirectory();
103105

104106
/**
105-
* @brief Check whether the provided file exists.
107+
* @brief Checks whether the provided file exists.
106108
*
107-
* @param file_path Path to the file.
109+
* @param file_path The path of the file.
108110
*
109-
* @return \c true if any file with the given path exists, \c false otherwise.
111+
* @return True if the file with the given path exists; false otherwise.
110112
*/
111113
static bool FileExists(const std::string& file_path);
112114

113115
/**
114-
* @brief Calculates size of the directory. Filter may be applied to exclude
115-
* unnecessary files or directories from calculation.
116+
* @brief Calculates the size of a directory.
116117
*
117-
* @param path Path of the directory.
118-
* @param filter_fn Filter function.
118+
* Use a filter to exclude
119+
* unnecessary files or directories from the calculation.
119120
*
120-
* @return Calculated size.
121+
* @param path The path of the directory.
122+
* @param filter_fn The filter function.
123+
*
124+
* @return The calculated size.
121125
*/
122126
static uint64_t Size(const std::string& path, FilterFunction filter_fn = {});
123127
};

0 commit comments

Comments
 (0)