diff options
| author | Hannes Schulze <haschu0103@outlook.de> | 2025-02-12 23:57:32 +0100 |
|---|---|---|
| committer | Hannes Schulze <haschu0103@outlook.de> | 2025-02-12 23:57:32 +0100 |
| commit | dd22e1ab7ab7b5bac841dae2b62bfa200b36c4d8 (patch) | |
| tree | 900781940d2ed92df1d87cc7dd6209853492e07f /lib/nes/common | |
| parent | 0de4957a22dd408793d0526351bcb7d61786fe86 (diff) | |
add encryption/decryption
Diffstat (limited to 'lib/nes/common')
| -rw-r--r-- | lib/nes/common/containers/string-builder.cc | 13 | ||||
| -rw-r--r-- | lib/nes/common/containers/string-builder.hh | 3 |
2 files changed, 16 insertions, 0 deletions
diff --git a/lib/nes/common/containers/string-builder.cc b/lib/nes/common/containers/string-builder.cc index ad2f97f..8182955 100644 --- a/lib/nes/common/containers/string-builder.cc +++ b/lib/nes/common/containers/string-builder.cc @@ -253,4 +253,17 @@ namespace nes return status::error_invalid_format_string; } + + auto string_builder::remove_last() -> status + { + if (length_ == 0) { return status::error_buffer_overflow; } + + length_ -= 1; + return status::success; + } + + auto string_builder::clear() -> void + { + length_ = 0; + } } // namespace nes
\ No newline at end of file diff --git a/lib/nes/common/containers/string-builder.hh b/lib/nes/common/containers/string-builder.hh index 7dcbb34..a533461 100644 --- a/lib/nes/common/containers/string-builder.hh +++ b/lib/nes/common/containers/string-builder.hh @@ -92,6 +92,9 @@ namespace nes return append_format(fmt, arg_wrappers, arg_count); } + auto remove_last() -> status; + auto clear() -> void; + private: auto append_format(string_view fmt, format_arg const* args, u32 arg_count) -> status; auto append_format_arg(format_arg, string_view params) -> status; |
