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 FileSummary | Denormalized view + cell inventory (no geometry). |
| struct RoomFileInfo | Version, 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
| Member | Description |
|---|---|
ViewType view | Primary view kind in the file. |
std::uint32_t cellCount | Number of cells in the library. |
std::string primaryCell | First cell name (convention for single-cell files). |
bool empty() const | True when count and name are unset. |
struct RoomFileInfo
| Member | Description |
|---|---|
std::string version | ROOM format version (e.g. 1.0). |
std::string generator | Tool that wrote the file. |
std::string technology | PDK / technology label. |
std::string libName | Library name. |
FileSummary summary | Sniff 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";