mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-21 05:43:42 -07:00
git subrepo clone https://github.com/HarbourMasters/ZAPDTR.git
subrepo: subdir: "ZAPDTR" merged: "a53a53ea4" upstream: origin: "https://github.com/HarbourMasters/ZAPDTR.git" branch: "master" commit: "a53a53ea4" git-subrepo: version: "0.4.1" origin: "???" commit: "???"
This commit is contained in:
parent
f52a2a6406
commit
5dda5762ba
217 changed files with 47152 additions and 0 deletions
40
ZAPDTR/ZAPD/OutputFormatter.h
Normal file
40
ZAPDTR/ZAPD/OutputFormatter.h
Normal file
|
@ -0,0 +1,40 @@
|
|||
#pragma once
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
class OutputFormatter
|
||||
{
|
||||
private:
|
||||
const uint32_t tabSize;
|
||||
const uint32_t lineLimit;
|
||||
|
||||
uint32_t col;
|
||||
uint32_t nest;
|
||||
uint32_t nestIndent[8];
|
||||
uint32_t currentIndent;
|
||||
uint32_t wordNests;
|
||||
|
||||
char word[128];
|
||||
char space[128];
|
||||
char* wordP;
|
||||
char* spaceP;
|
||||
|
||||
std::string str;
|
||||
|
||||
void Flush();
|
||||
|
||||
static OutputFormatter* Instance;
|
||||
static int WriteStatic(const char* buf, int count);
|
||||
|
||||
public:
|
||||
OutputFormatter(uint32_t tabSize = 4, uint32_t indentation = 4, uint32_t lineLimit = 120);
|
||||
|
||||
int (*StaticWriter())(const char* buf, int count); // Must be `int` due to libgfxd
|
||||
|
||||
int Write(const char* buf, int count);
|
||||
int Write(const std::string& buf);
|
||||
|
||||
std::string GetOutput();
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue