diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2026-02-12 20:57:17 +0100 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2026-02-12 20:57:17 +0100 |
| commit | b333b06772c89d96aacb5490d6a219fba7c09cc6 (patch) | |
| tree | 211df60083a5946baa2ed61d33d8121b7e251b06 /llama.cpp/src/llama-io.cpp | |
| download | llmnpc-b333b06772c89d96aacb5490d6a219fba7c09cc6.tar.gz | |
Engage!
Diffstat (limited to 'llama.cpp/src/llama-io.cpp')
| -rw-r--r-- | llama.cpp/src/llama-io.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/llama.cpp/src/llama-io.cpp b/llama.cpp/src/llama-io.cpp new file mode 100644 index 0000000..7ad70d1 --- /dev/null +++ b/llama.cpp/src/llama-io.cpp | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | #include "llama-io.h" | ||
| 2 | |||
| 3 | void llama_io_write_i::write_string(const std::string & str) { | ||
| 4 | uint32_t str_size = str.size(); | ||
| 5 | |||
| 6 | write(&str_size, sizeof(str_size)); | ||
| 7 | write(str.data(), str_size); | ||
| 8 | } | ||
| 9 | |||
| 10 | void llama_io_read_i::read_string(std::string & str) { | ||
| 11 | uint32_t str_size; | ||
| 12 | read_to(&str_size, sizeof(str_size)); | ||
| 13 | |||
| 14 | str.assign((const char *) read(str_size), str_size); | ||
| 15 | } | ||
