Compare commits
2 commits
55ad862ba4
...
8d2041e946
Author | SHA1 | Date | |
---|---|---|---|
LordMZTE | 8d2041e946 | ||
LordMZTE | 5034e42a2c |
9
src/ansi.hpp
Normal file
9
src/ansi.hpp
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
namespace ansi {
|
||||||
|
const char *reset = "\033[0m";
|
||||||
|
|
||||||
|
const char *cyan = "\033[0;36m";
|
||||||
|
const char *green = "\033[0;32m";
|
||||||
|
const char *yellow = "\033[0;33m";
|
||||||
|
} // namespace ansi
|
|
@ -1,3 +1,4 @@
|
||||||
|
#pragma once
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#pragma once
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#pragma once
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#include "mappings.hpp"
|
#include "mappings.hpp"
|
||||||
|
#include "ansi.hpp"
|
||||||
#include "csv.hpp"
|
#include "csv.hpp"
|
||||||
#include <boost/algorithm/string.hpp>
|
#include <boost/algorithm/string.hpp>
|
||||||
#include <boost/algorithm/string/classification.hpp>
|
#include <boost/algorithm/string/classification.hpp>
|
||||||
|
@ -71,16 +72,22 @@ Mappings Mappings::load() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void showMapInfo(Mapping mapping, std::optional<std::string> rename) {
|
void showMapInfo(Mapping mapping, std::optional<std::string> rename) {
|
||||||
auto doc = mapping.doc.has_value() ? "\n\n\t" + *mapping.doc + "\n" : "";
|
auto doc = mapping.doc.has_value()
|
||||||
|
? std::string(ansi::yellow) + "\n\n\t" + *mapping.doc + "\n"
|
||||||
|
: "";
|
||||||
if (rename.has_value()) {
|
if (rename.has_value()) {
|
||||||
BOOST_LOG_TRIVIAL(info)
|
BOOST_LOG_TRIVIAL(info)
|
||||||
<< "\nFound mapping:\n"
|
<< "\nFound mapping:\n"
|
||||||
<< "\n\tOriginal\t" << mapping.orig << "\n\tRemapped\t" << mapping.name
|
<< ansi::cyan << "\n\tOriginal\t" << ansi::green << mapping.orig
|
||||||
<< "\n\tRenamed \t" << *rename << doc;
|
<< ansi::cyan << "\n\tRemapped\t" << ansi::green << mapping.name
|
||||||
|
<< ansi::cyan << "\n\tRenamed \t" << ansi::green << *rename << doc
|
||||||
|
<< ansi::reset;
|
||||||
} else {
|
} else {
|
||||||
BOOST_LOG_TRIVIAL(info) << "\nFound mapping:\n"
|
BOOST_LOG_TRIVIAL(info)
|
||||||
<< "\n\tOriginal\t" << mapping.orig
|
<< "\nFound mapping:\n"
|
||||||
<< "\n\tRemapped\t" << mapping.name << doc;
|
<< ansi::cyan << "\n\tOriginal\t" << ansi::green << mapping.orig
|
||||||
|
<< ansi::cyan << "\n\tRemapped\t" << ansi::green << mapping.name << doc
|
||||||
|
<< ansi::reset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#pragma once
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <optional>
|
#include <optional>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#pragma once
|
||||||
#include <string>
|
#include <string>
|
||||||
namespace resourceloc {
|
namespace resourceloc {
|
||||||
std::string resolve(std::string inp);
|
std::string resolve(std::string inp);
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#pragma once
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue