mirror of
https://github.com/trabucayre/openFPGALoader.git
synced 2026-08-30 09:59:03 +02:00
all/everything/world: removed using namespace std to be able to compile in c++17 with windows
This commit is contained in:
+10
-11
@@ -10,19 +10,18 @@
|
||||
#include "display.hpp"
|
||||
#include "efinixHexParser.hpp"
|
||||
|
||||
using namespace std;
|
||||
|
||||
EfinixHexParser::EfinixHexParser(const string &filename):
|
||||
EfinixHexParser::EfinixHexParser(const std::string &filename):
|
||||
ConfigBitstreamParser(filename, ConfigBitstreamParser::ASCII_MODE,
|
||||
false)
|
||||
{}
|
||||
|
||||
int EfinixHexParser::parseHeader()
|
||||
{
|
||||
string buffer;
|
||||
istringstream lineStream(_raw_data);
|
||||
std::string buffer;
|
||||
std::istringstream lineStream(_raw_data);
|
||||
int bytesRead = 0;
|
||||
string headerText;
|
||||
std::string headerText;
|
||||
bool foundPaddedBits = false;
|
||||
|
||||
while (std::getline(lineStream, buffer, '\n')) {
|
||||
@@ -40,20 +39,20 @@ int EfinixHexParser::parseHeader()
|
||||
break;
|
||||
}
|
||||
|
||||
if (headerText.find("PADDED_BITS") != string::npos)
|
||||
if (headerText.find("PADDED_BITS") != std::string::npos)
|
||||
foundPaddedBits = true;
|
||||
}
|
||||
|
||||
size_t pos;
|
||||
if ((pos = headerText.find("Mode: ")) != string::npos) {
|
||||
if ((pos = headerText.find("Mode: ")) != std::string::npos) {
|
||||
size_t end = headerText.find('\n', pos);
|
||||
_hdr["mode"] = headerText.substr(pos + 6, end - pos - 6);
|
||||
}
|
||||
if ((pos = headerText.find("Width: ")) != string::npos) {
|
||||
if ((pos = headerText.find("Width: ")) != std::string::npos) {
|
||||
size_t end = headerText.find('\n', pos);
|
||||
_hdr["width"] = headerText.substr(pos + 7, end - pos - 7);
|
||||
}
|
||||
if ((pos = headerText.find("Device: ")) != string::npos) {
|
||||
if ((pos = headerText.find("Device: ")) != std::string::npos) {
|
||||
size_t end = headerText.find('\n', pos);
|
||||
_hdr["device"] = headerText.substr(pos + 8, end - pos - 8);
|
||||
}
|
||||
@@ -63,10 +62,10 @@ int EfinixHexParser::parseHeader()
|
||||
|
||||
int EfinixHexParser::parse()
|
||||
{
|
||||
string buffer;
|
||||
std::string buffer;
|
||||
parseHeader();
|
||||
|
||||
istringstream lineStream(_raw_data);
|
||||
std::istringstream lineStream(_raw_data);
|
||||
|
||||
while (std::getline(lineStream, buffer, '\n')) {
|
||||
_bit_data.push_back(std::stol(buffer, nullptr, 16));
|
||||
|
||||
Reference in New Issue
Block a user