xmreg:page
This commit is contained in:
parent
8247faf232
commit
28a7df74e0
8
main.cpp
8
main.cpp
|
@ -1,6 +1,8 @@
|
||||||
|
|
||||||
#include "src/MicroCore.h"
|
#include "src/MicroCore.h"
|
||||||
|
|
||||||
|
#include "src/page.h"
|
||||||
|
|
||||||
#include "ext/crow/crow.h"
|
#include "ext/crow/crow.h"
|
||||||
#include "mstch/mstch.hpp"
|
#include "mstch/mstch.hpp"
|
||||||
#include "ext/format.h"
|
#include "ext/format.h"
|
||||||
|
@ -43,9 +45,11 @@ int main() {
|
||||||
"Top block height : {:d}\n", height);
|
"Top block height : {:d}\n", height);
|
||||||
|
|
||||||
|
|
||||||
std::string view = xmreg::read("./templates/index.html");
|
xmreg::page xmrblocks;
|
||||||
|
|
||||||
mstch::map context {
|
std::string view = xmrblocks.index();
|
||||||
|
|
||||||
|
mstch::map context {
|
||||||
{"height", fmt::format("{:d}", height)},
|
{"height", fmt::format("{:d}", height)},
|
||||||
{"blocks", mstch::array()}
|
{"blocks", mstch::array()}
|
||||||
};
|
};
|
||||||
|
|
|
@ -12,7 +12,7 @@ set(SOURCE_FILES
|
||||||
MicroCore.cpp
|
MicroCore.cpp
|
||||||
tools.cpp
|
tools.cpp
|
||||||
CmdLineOptions.cpp
|
CmdLineOptions.cpp
|
||||||
tx_details.cpp)
|
tx_details.cpp page.cpp page.h)
|
||||||
|
|
||||||
# make static library called libmyxrm
|
# make static library called libmyxrm
|
||||||
# that we are going to link to
|
# that we are going to link to
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
//
|
||||||
|
// Created by mwo on 8/04/16.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "page.h"
|
|
@ -0,0 +1,43 @@
|
||||||
|
//
|
||||||
|
// Created by mwo on 8/04/16.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef CROWXMR_PAGE_H
|
||||||
|
#define CROWXMR_PAGE_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "../ext/minicsv.h"
|
||||||
|
|
||||||
|
#include "monero_headers.h"
|
||||||
|
#include "tools.h"
|
||||||
|
|
||||||
|
|
||||||
|
#define TMPL_DIR "./templates"
|
||||||
|
#define TMPL_INDEX TMPL_DIR "/index.html"
|
||||||
|
|
||||||
|
#define READ_TMPL(tmpl_path) xmreg::read(tmpl_path)
|
||||||
|
|
||||||
|
namespace xmreg {
|
||||||
|
|
||||||
|
|
||||||
|
class page {
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
string
|
||||||
|
index()
|
||||||
|
{
|
||||||
|
std::string view = READ_TMPL(TMPL_INDEX);
|
||||||
|
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif //CROWXMR_PAGE_H
|
Loading…
Reference in New Issue