35 # if defined(DEBUG_WITH_FILES)
50 bool dumpFile(WPXBinaryData &data,
char const *fileName);
57 typedef std::stringstream DebugStream;
66 : m_file(), m_on(false), m_input(ip), m_actOffset(-1), m_notes(), m_skipZones() { }
79 bool open(std::string
const &filename);
87 m_skipZones.resize(0);
98 void skipZone(
long beginPos,
long endPos)
100 if (m_on) m_skipZones.push_back(
Vec2<long>(beginPos, endPos));
111 mutable std::ofstream m_file;
122 NotePos() : m_pos(-1), m_text(
""), m_breaking(false) { }
125 NotePos(
long p, std::string
const &n,
bool br=
true) : m_pos(p), m_text(n), m_breaking(br) {}
134 bool operator<(NotePos
const &p)
const
136 long diff = m_pos-p.m_pos;
137 if (diff)
return (diff < 0) ?
true :
false;
138 if (m_breaking != p.m_breaking)
return m_breaking;
139 return m_text < p.m_text;
147 bool operator()(NotePos
const &s1, NotePos
const &s2)
const
155 typedef std::map<NotePos, int,struct NotePosLt> Map;
161 std::vector<NotePos> m_notes;
163 std::vector<Vec2<long> > m_skipZones;
171 inline bool dumpFile(WPXBinaryData &,
char const *)
193 return std::string(
"");
195 void str(std::string
const &) { }
void addNote(char const *)
Definition: WPSDebug.h:212
shared_ptr< WPXInputStream > WPXInputStreamPtr
Definition: libwps_internal.h:74
std::string str() const
Definition: WPSDebug.h:191
Definition: WPSDebug.h:198
void str(std::string const &)
Definition: WPSDebug.h:195
Definition: WPSDebug.h:182
bool dumpFile(WPXBinaryData &, char const *)
Definition: WPSDebug.h:171
void addDelimiter(long, char)
Definition: WPSDebug.h:213
~DebugFile()
Definition: WPSDebug.h:204
void reset()
Definition: WPSDebug.h:215
void addPos(long)
Definition: WPSDebug.h:211
DebugStream & operator<<(T const &)
Definition: WPSDebug.h:186
void skipZone(long, long)
Definition: WPSDebug.h:217
DebugFile()
Definition: WPSDebug.h:202
std::string flattenFileName(std::string const &name)
Definition: WPSDebug.h:176
small class which defines a vector with 2 elements
Definition: libwps_internal.h:313
bool open(std::string const &)
Definition: WPSDebug.h:206
void setStream(WPXInputStreamPtr)
Definition: WPSDebug.h:203
DebugFile(WPXInputStreamPtr)
Definition: WPSDebug.h:201