-
Notifications
You must be signed in to change notification settings - Fork 0
/
solace.hpp
42 lines (34 loc) · 1.37 KB
/
solace.hpp
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
39
40
41
42
// solace - a console replacement. forked and rewritten from https://github.com/rxi/lovebird
// - rlyeh, zlib/libpng licensed
#pragma once
#include <iostream>
#include <vector>
#include <string>
#include <map>
namespace solace {
// public logging api
extern std::ostream &cout;
//
void set_highlights( const std::vector<std::string>& );
// std::ostream capture; when you want to capture std::cout, std::cerr, and others.
bool capture( std::ostream &out );
bool release( std::ostream &out );
// stdout, stderr capture; when you want to capture printf() and company.
bool capture( int fd );
bool release( int fd );
// install html server with custom callbacks
bool webinstall(
// port to listen to
int port = 8080,
// script/expression evaluator (like LUA, angelscript, your own, or null for none)
std::string (*eval)( const std::string &cmd ) = 0,
// list of current symbols in keypath level tree (or null for none)
// - if value is empty subnode type is assumed,
// - else if value is \"quoted\" string type is assumed,
// - else number type is assumed.
std::map<std::string,std::string> (*get_property_list)( const std::string &keypath ) = 0
);
bool webopen();
// get local webhome directory
std::string webhome( const std::string &suffix = std::string() );
}