ROOM » Core » File summary & sniff

File summary and sniff

Read .room metadata without decoding geometry payloads. More…

Header:#include "file_summary.h"
CMake:target_link_libraries(mytarget PRIVATE ROOM::room)

Public Types

struct FileSummaryDenormalized view + cell inventory (no geometry).
struct RoomFileInfoVersion, generator, technology, lib name, and summary.

Public Functions

RoomFileInfo sniffRoomFile(const std::string & path)Sniff a .room file from disk.
static FileSummary FileSummary::fromLib(const Lib &, ViewType)Build summary when saving.
FileSummary readFileSummary(schema::FileSummary::Reader)Decode Cap'n Proto summary field.
void writeFileSummary(schema::FileSummary::Builder, const FileSummary &)Encode summary on save.

Detailed Description

Cap'n Proto Database.summary stores a denormalized header for fast tool routing. LibMan uses sniff to choose KLayout vs Xschem without loading shapes. If summary is missing (older files), sniffRoomFile scans cell view types from the lib section only.

See also docs/SNIFF.md and Database::fileSummary().

Member Type Documentation

struct FileSummary

MemberDescription
ViewType viewPrimary view kind in the file.
std::uint32_t cellCountNumber of cells in the library.
std::string primaryCellFirst cell name (convention for single-cell files).
bool empty() constTrue when count and name are unset.

struct RoomFileInfo

MemberDescription
std::string versionROOM format version (e.g. 1.0).
std::string generatorTool that wrote the file.
std::string technologyPDK / technology label.
std::string libNameLibrary name.
FileSummary summarySniff result for view routing.

Member Function Documentation

RoomFileInfo sniffRoomFile(const std::string & path)

Opens the file, reads the Cap'n Proto root message, and returns header fields. Does not deserialize payload geometry.

Throws: std::runtime_error if the file cannot be opened or parsed.

Example

#include "file_summary.h"
#include "enums.h"

room::RoomFileInfo info = room::sniffRoomFile("inv.schematic.room");
std::cout << room::viewTypeToString(info.summary.view) << " "
          << info.summary.cellCount << " cells\n";