-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUtils.h
38 lines (28 loc) · 1.31 KB
/
Utils.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef UTILS_H
#define UTILS_H
#include <string>
#include <iostream>
#include <vector>
#include <fstream>
#include <algorithm>
#include <regex>
class Utils{
public:
static int getWireCount(std::vector<std::string> tokens);
//Checks if the given string is a valid number
static bool validNumberString(std::string str);
//Checks if the given string is a Spice option
static bool isStringValueSpiceOption(std::string str);
//Checks if the given string is a boolean valued Spice option
static bool isBoolValueSpiceOption(std::string str);
//Checks if the given string is a numeric valued Spice option
static bool isNumericSpiceOption(std::string str);
//Checks if the given string is a valid string value for the given Spice option name
static bool isValidStringValueForSpiceOption(std::string optionName, std::string str);
//Reads lines from a Verilog file and creates a line vector
static std::vector<std::string> getLinesFromVerilogFile(std::string fileName);
//Reads lines from a Delay file and creates a line vector
static std::vector<std::string> getLinesFromDelayFile(std::string fileName);
static std::vector<std::string> splitStringByDelimiter(std::string str, char del);
};
#endif // UTILS_H