ChimeraTK-DeviceAccess  03.18.00
DMapFileParser.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Deutsches Elektronen-Synchrotron DESY, MSK, ChimeraTK Project <chimeratk-support@desy.de>
2 // SPDX-License-Identifier: LGPL-3.0-or-later
3 #pragma once
4 
5 #include "DeviceInfoMap.h"
6 #include "Exception.h"
7 
8 #include <cstdint>
9 #include <string>
10 
11 namespace ChimeraTK {
12 
20  public:
33  static DeviceInfoMapPointer parse(const std::string& file_name);
34 
35  protected:
36  // @todo FIXME passing the arguments C-style is super ugly
37  static void parseForLoadLib(
38  const std::string& file_name, const std::string& line, uint32_t line_nr, const DeviceInfoMapPointer& dmap);
39  static void parseRegularLine(
40  const std::string& file_name, const std::string& line, uint32_t line_nr, const DeviceInfoMapPointer& dmap);
41  static void raiseException(const std::string& file_name, const std::string& line, uint32_t line_nr);
42 
43  // Entries in the dmap file can be relative to the dmap file.
44  // The dmap file itself can be an absolute or relative path.
45  // This function return the absolute path of the dmap entry, correctly
46  // resolved with respect to the dmap file.
47  static std::string absPathOfDMapContent(const std::string& dmapContent, const std::string& dmapFileName);
48  };
49 
50 } // namespace ChimeraTK
ChimeraTK::DMapFileParser::parse
static DeviceInfoMapPointer parse(const std::string &file_name)
Performs parsing of specified DMAP file.
Definition: DMapFileParser.cpp:18
ChimeraTK::DMapFileParser::parseForLoadLib
static void parseForLoadLib(const std::string &file_name, const std::string &line, uint32_t line_nr, const DeviceInfoMapPointer &dmap)
Definition: DMapFileParser.cpp:54
ChimeraTK::DMapFileParser::parseRegularLine
static void parseRegularLine(const std::string &file_name, const std::string &line, uint32_t line_nr, const DeviceInfoMapPointer &dmap)
Definition: DMapFileParser.cpp:69
ChimeraTK::DeviceInfoMapPointer
boost::shared_ptr< DeviceInfoMap > DeviceInfoMapPointer
Definition: DeviceInfoMap.h:221
ChimeraTK::DMapFileParser::raiseException
static void raiseException(const std::string &file_name, const std::string &line, uint32_t line_nr)
Definition: DMapFileParser.cpp:113
ChimeraTK::DMapFileParser
Provides method to parse DMAP file.
Definition: DMapFileParser.h:19
ChimeraTK::DMapFileParser::absPathOfDMapContent
static std::string absPathOfDMapContent(const std::string &dmapContent, const std::string &dmapFileName)
Definition: DMapFileParser.cpp:103
DeviceInfoMap.h
Exception.h
ChimeraTK
Definition: DummyBackend.h:16