Fletchgen
The Fletcher Design Generator
utils.h
1 // Copyright 2018-2019 Delft University of Technology
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #pragma once
16 
17 #include <fletcher/common.h>
18 #include <cerata/api.h>
19 
20 #include <string>
21 
23 namespace fletchgen {
24 
26 std::string GetProgramName(char *argv0);
27 
29 cerata::Port::Dir mode2dir(fletcher::Mode mode);
30 
39 void LogCerata(cerata::LogLevel level,
40  std::string const &message,
41  char const *source_function,
42  char const *source_file,
43  int line_number);
44 
46 constexpr char DEFAULT_NOTICE[] = "-- Copyright 2018-2019 Delft University of Technology\n"
47  "--\n"
48  "-- Licensed under the Apache License, Version 2.0 (the \"License\");\n"
49  "-- you may not use this file except in compliance with the License.\n"
50  "-- You may obtain a copy of the License at\n"
51  "--\n"
52  "-- http://www.apache.org/licenses/LICENSE-2.0\n"
53  "--\n"
54  "-- Unless required by applicable law or agreed to in writing, software\n"
55  "-- distributed under the License is distributed on an \"AS IS\" BASIS,\n"
56  "-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n"
57  "-- See the License for the specific language governing permissions and\n"
58  "-- limitations under the License.\n"
59  "--\n"
60  "-- This file was generated by Fletchgen. Modify this file at your own risk.\n"
61  "\n";
62 
64 std::string version();
65 
66 } // namespace fletchgen
Contains all classes and functions related to Fletchgen.
Definition: array.cc:29
void LogCerata(cerata::LogLevel level, std::string const &message, char const *source_function, char const *source_file, int line_number)
Callback function for the Cerata logger.
Definition: utils.cc:43
constexpr char DEFAULT_NOTICE[]
Default copyright notice.
Definition: utils.h:46
std::string GetProgramName(char *argv0)
Return the name of this program executable.
Definition: utils.cc:25
std::string version()
Return Fletchgen version string.
Definition: utils.cc:72
cerata::Port::Dir mode2dir(fletcher::Mode mode)
Return a Cerata port direction from a Fletcher access mode.
Definition: utils.cc:35