#pragma once #include #include "String.h" using Path = std::filesystem::path; class QuantumCircuit; class QuantumCircuitElement; class QuantumCircuitReader { public: Ptr read(const Path& path); Ptr read(const String& content); private: using Location = std::pair; void onLine(const String& line, size_t jdx); String checkForKet(const String& segment); String checkForGate(const String& segment); size_t getWireEnd(const String& segment); void onGate(Location loc, const String value); void onKet(Location loc, const String value); void onLineEnd(); void onVertialQuantumWire(Location loc); String mWorkingString; QuantumCircuitElement* mWorkingElement{ nullptr }; QuantumCircuit* mWorkingCircuit{ nullptr }; };