ROOM » Core » ROOM path helpers

ROOM path helpers

Parse and build view-specific <cell>.<view>.room filenames. More…

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

Public Types

struct ParsedRoomPathCell name, view, and validity flag.

Public Functions

std::string roomFileName(cell, ViewType)Build filename.
ParsedRoomPath parseRoomFilePath(path)Parse cell.view.room.
bool isViewRoomFile(path, ViewType)Match view suffix.
bool isRoomFilePath(path)Any *.room extension.
std::string roomFileGlob(ViewType)Glob pattern e.g. *.schematic.room.
std::optional<ViewType> parseViewTypeName(text)Parse view suffix token.

Detailed Description

LibMan, Xschem Tcl (coreapi_parse_core_path), and project files use these helpers. See ROOM_FILE_NAMING.md.

struct ParsedRoomPath

cellName, view, valid — set when basename matches name.view.room.

Example

auto p = room::parseRoomFilePath("lib/inv.schematic.room");
if (p.valid) { /* p.cellName == "inv", p.view == Schematic */ }