Select Git revision
translators.cpp
-
Carl Philipp Klemm authored
improve relaxis translateor
Carl Philipp Klemm authoredimprove relaxis translateor
translators.cpp 13.80 KiB
#include "translators.h"
#include <vector>
#include <iostream>
#include <cassert>
#include <map>
#include <algorithm>
#include <sstream>
#include "strops.h"
#include "eistype.h"
#include "log.h"
#include "componant.h"
namespace eis
{
const struct std::pair<const char*, const char*> eisRelaxisTable[] =
{
{"r", "R"},
{"R", "R"},
{"c", "C"},
{"C", "C"},
{"l", "I"},
{"L", "I"},
{"p", "P"},
{"P", "P"},
{"w", "W"},
{"W", "W"},
{"t", "Tlmo"},
{"T", "Tlmo"},
{nullptr, nullptr}
};
const struct std::pair<const char*, const char*> eisCdcTable[] =
{
{"r", "R"},
{"R", "R"},
{"c", "C"},
{"C", "C"},
{"l", "L"},
{"L", "L"},
{"p", "P"},
{"P", "P"},
{"w", "W"},
{"W", "W"},
{"t", "T"},
{"T", "T"},
{nullptr, nullptr}
};
const struct std::pair<const char*, const char*> eisMadapTable[] =
{
{"r", "R"},
{"R", "R"},
{"c", "C"},
{"C", "C"},
{"l", "L"},
{"L", "L"},
{"p", "CPE"},
{"P", "CPE"},
{"w", "W"},
{"W", "W"},
{"w", "Wo"},
{"W", "Wo"},
{nullptr, nullptr}
};
static std::string translateElement(const std::string& in, const struct std::pair<const char*, const char*>* table, bool reverse = false)
{
size_t i = 0;