+ sizeof(core::CacheEntryHeader::entry_size)
// ccache_version length field:
+ 1
- // tag length field:
+ // namespace_ length field:
+ 1;
const size_t k_static_epilogue_fields_size =
const int8_t compression_level_,
const uint64_t creation_time_,
const std::string& ccache_version_,
- const std::string& tag_,
+ const std::string& namespace_arg,
const uint64_t entry_size_)
: magic(k_ccache_magic),
entry_format_version(k_entry_format_version),
compression_level(compression_level_),
creation_time(creation_time_),
ccache_version(ccache_version_),
- tag(tag_),
+ namespace_(namespace_arg),
entry_size(entry_size_)
{
}
PRINT(stream, "Compression level: {}\n", compression_level);
PRINT(stream, "Creation time: {}\n", creation_time);
PRINT(stream, "Ccache version: {}\n", ccache_version);
- PRINT(stream, "Tag: {}\n", tag);
+ PRINT(stream, "Namespace: {}\n", namespace_);
PRINT(stream, "Entry size: {}\n", entry_size);
}
size_t
CacheEntryHeader::non_payload_size() const
{
- return k_static_header_fields_size + ccache_version.length() + tag.length()
- + k_static_epilogue_fields_size;
+ return k_static_header_fields_size + ccache_version.length()
+ + namespace_.length() + k_static_epilogue_fields_size;
}
} // namespace core
//
// <entry> ::= <header> <payload> <epilogue>
// <header> ::= <magic> <format_ver> <entry_type> <compr_type>
-// <compr_level> <creation_time> <ccache_ver> <tag>
+// <compr_level> <creation_time> <ccache_ver> <namespace>
// <entry_size>
// <magic> ::= uint16_t (0xccac)
// <format_ver> ::= uint8_t
// <compr_level> ::= int8_t
// <creation_time> ::= uint64_t (Unix epoch time when entry was created)
// <ccache_ver> ::= string length (uint8_t) + string data
-// <tag> ::= string length (uint8_t) + string data
+// <namespace> ::= string length (uint8_t) + string data
// <entry_size> ::= uint64_t ; = size of file if stored uncompressed
// ; potentially compressed from here
// <payload> ::= depends on entry_type
int8_t compression_level,
uint64_t creation_time,
const std::string& ccache_version,
- const std::string& tag,
+ const std::string& namespace_,
uint64_t entry_size = 0);
uint16_t magic;
int8_t compression_level;
uint64_t creation_time;
std::string ccache_version;
- std::string tag;
+ std::string namespace_;
uint64_t entry_size;
uint64_t payload_size() const;
m_checksumming_writer.write_int(header.creation_time);
m_checksumming_writer.write_int<uint8_t>(header.ccache_version.length());
m_checksumming_writer.write_str(header.ccache_version);
- m_checksumming_writer.write_int<uint8_t>(header.tag.length());
- m_checksumming_writer.write_str(header.tag);
+ m_checksumming_writer.write_int<uint8_t>(header.namespace_.length());
+ m_checksumming_writer.write_str(header.namespace_);
m_checksumming_writer.write_int(header.entry_size);
m_checksumming_writer.set_writer(*m_compressor);