1
0
mirror of https://github.com/zeldaret/oot.git synced 2024-09-22 13:25:00 +00:00
oot/tools/ZAPD/ZAPD/OutputFormatter.h
Dragorn421 4e55168eaa
Update ZAPD (#1569)
* git subrepo pull --force tools/ZAPD

subrepo:
  subdir:   "tools/ZAPD"
  merged:   "094e79734"
upstream:
  origin:   "https://github.com/zeldaret/ZAPD.git"
  branch:   "master"
  commit:   "094e79734"
git-subrepo:
  version:  "0.4.6"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "110b9eb"

* Add EnumData.xml where some names are now externalized

* Remove legacy typedefs for zapd, no longer needed!
2023-10-24 21:36:10 -04:00

42 lines
756 B
C++

#pragma once
#include <cstdint>
#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();
};