z3-z3-4.13.0.src.test.lp.test_file_reader.h Maven / Gradle / Ivy
The newest version!
/*++
Copyright (c) 2017 Microsoft Corporation
Module Name:
Abstract:
Author:
Lev Nachmanson (levnach)
Revision History:
--*/
#pragma once
// reads a text file
#include
#include
#include
#include
#include
#include "math/lp/lp_utils.h"
namespace lp {
template
struct test_result {
lp_status m_status;
T m_cost;
std::unordered_map column_values;
};
template
class test_file_reader {
struct raw_blob {
std::vector m_unparsed_strings;
std::vector m_blobs;
};
struct test_file_blob {
std::string m_name;
std::string m_content;
std::unordered_map m_table;
std::unordered_map m_blobs;
test_result * get_test_result() {
test_result * tr = new test_result();
throw "not impl";
return tr;
}
};
std::ifstream m_file_stream;
public:
// constructor
test_file_reader(std::string file_name) : m_file_stream(file_name) {
if (!m_file_stream.is_open()) {
std::cout << "cannot open file " << "\'" << file_name << "\'" << std::endl;
}
}
raw_blob scan_to_row_blob() {
}
test_file_blob scan_row_blob_to_test_file_blob(raw_blob /* rblob */) {
}
test_result * get_test_result() {
if (!m_file_stream.is_open()) {
return nullptr;
}
raw_blob rblob = scan_to_row_blob();
test_file_blob tblob = scan_row_blob_to_test_file_blob(rblob);
return tblob.get_test_result();
}
};
}