ChimeraTK-DeviceAccess 03.25.00
Loading...
Searching...
No Matches
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
11namespace 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
Provides method to parse DMAP file.
static void raiseException(const std::string &file_name, const std::string &line, uint32_t line_nr)
static void parseRegularLine(const std::string &file_name, const std::string &line, uint32_t line_nr, const DeviceInfoMapPointer &dmap)
static void parseForLoadLib(const std::string &file_name, const std::string &line, uint32_t line_nr, const DeviceInfoMapPointer &dmap)
static std::string absPathOfDMapContent(const std::string &dmapContent, const std::string &dmapFileName)
static DeviceInfoMapPointer parse(const std::string &file_name)
Performs parsing of specified DMAP file.
boost::shared_ptr< DeviceInfoMap > DeviceInfoMapPointer
Introduce specialisation of shared_pointer template for pointers to RegisterInfoMap object as a Devic...