GCC Code Coverage Report


Directory: ../
File: src/util/RawStringOStream.cpp
Date: 2025-11-11 23:26:16
Coverage Exec Excl Total
Lines: 100.0% 0 7 7
Functions: -% 0 4 4
Branches: -% 0 2 2

Line Branch Exec Source
1 // Copyright (c) 2021-2025 ChilliBits. All rights reserved.
2
3 #include "RawStringOStream.h"
4
5 namespace spice::compiler {
6
7 // LCOV_EXCL_START
8 RawStringOStream::RawStringOStream(std::string &output) : raw_pwrite_stream(true), output(output) {}
9
10 void RawStringOStream::pwrite_impl(const char *Ptr, const size_t Size, const uint64_t Offset) {
11 assert(output.length() >= Offset + Size);
12 std::memcpy(output.data() + Offset, Ptr, Size);
13 }
14
15 void RawStringOStream::write_impl(const char *Ptr, const size_t Size) { output.append(Ptr, Size); }
16
17 uint64_t RawStringOStream::current_pos() const { return output.size(); }
18 // LCOV_EXCL_STOP
19
20 } // namespace spice::compiler
21