1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-01-16 05:26:59 +00:00
oot/tools/ZAPD/ZAPD/OutputFormatter.h
fig02 493bdbc3c6
git subrepo pull --force tools/ZAPD (#727)
subrepo:
  subdir:   "tools/ZAPD"
  merged:   "4751db5c9"
upstream:
  origin:   "https://github.com/zeldaret/ZAPD.git"
  branch:   "master"
  commit:   "4751db5c9"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo.git"
  commit:   "2f68596"
2021-03-20 12:02:12 -04:00

37 lines
No EOL
633 B
C++

#pragma once
#include <map>
#include <string>
#include <vector>
class OutputFormatter
{
private:
const int tab_size;
const int default_indent;
const int line_limit;
int col;
int nest;
int nest_indent[8];
int current_indent;
char word[128];
char space[128];
char* word_p;
char* space_p;
std::string str;
int write(const char* buf, int count);
static OutputFormatter* static_instance;
static int write_static(const char* buf, int count);
public:
OutputFormatter(int tab_size = 4, int default_indent = 4, int line_limit = 120);
int (*static_writer())(const char* buf, int count);
std::string get_output();
};