Add optional return

This commit is contained in:
Nikola Petrov
2023-08-27 20:38:26 +02:00
parent 375af5f3cd
commit 058e24d436
4 changed files with 16 additions and 21 deletions

View File

@@ -4,6 +4,7 @@ struct LoginInfoPointer;
class Buffer;
class Cryptography;
#include <string>
#include <optional>
enum class Arg
{
@@ -22,11 +23,11 @@ void print_args();
Arg get_args(int argc, char** argv, char** label);
LoginInfoPointer arg_get(Buffer& decrypted_buffer, const char* label);
std::optional<LoginInfoPointer> arg_get(Buffer& decrypted_buffer, const char* label);
LoginInfoPointer arg_generate(Buffer& decrypted_buffer, Buffer& encrypted_buffer, const char* label, Cryptography& crypto);
std::optional<LoginInfoPointer> arg_generate(Buffer& decrypted_buffer, Buffer& encrypted_buffer, const char* label, Cryptography& crypto);
LoginInfoPointer arg_input(Buffer& decrypted_buffer, Buffer& encrypted_buffer, const char* label, Cryptography& crypto);
std::optional<LoginInfoPointer> arg_input(Buffer& decrypted_buffer, Buffer& encrypted_buffer, const char* label, Cryptography& crypto);
void arg_list(Buffer& decrypted_buffer);

View File

@@ -13,8 +13,6 @@ struct LoginInfoPointer
{
const char* label;
const char* password;
LoginInfoPointer() : label(nullptr), password(nullptr) {}
};
struct Index