33 # if defined(DEBUG_WITH_FILES)
48 bool dumpFile(librevenge::RVNGBinaryData &data,
char const *fileName);
55 typedef std::stringstream DebugStream;
64 : m_file(), m_on(false), m_input(ip), m_actOffset(-1), m_notes(), m_skipZones() { }
77 bool open(std::string
const &filename);
85 m_skipZones.resize(0);
96 void skipZone(
long beginPos,
long endPos)
98 if (m_on) m_skipZones.push_back(
Vec2<long>(beginPos, endPos));
109 mutable std::ofstream m_file;
120 NotePos() : m_pos(-1), m_text(
""), m_breaking(false) { }
123 NotePos(
long p, std::string
const &n,
bool br=
true) : m_pos(p), m_text(n), m_breaking(br) {}
132 bool operator<(NotePos
const &p)
const
134 long diff = m_pos-p.m_pos;
135 if (diff)
return (diff < 0) ?
true :
false;
136 if (m_breaking != p.m_breaking)
return m_breaking;
137 return m_text < p.m_text;
145 bool operator()(NotePos
const &s1, NotePos
const &s2)
const
153 typedef std::map<NotePos, int,struct NotePosLt> Map;
159 std::vector<NotePos> m_notes;
161 std::vector<Vec2<long> > m_skipZones;
169 inline bool dumpFile(librevenge::RVNGBinaryData &,
char const *)
191 return std::string(
"");
193 static void str(std::string
const &) { }
204 static bool open(std::string
const &)
Definition: libwps_internal.cpp:32
static std::string str()
Definition: WPSDebug.h:189
Definition: WPSDebug.h:196
static void reset()
Definition: WPSDebug.h:213
static bool open(std::string const &)
Definition: WPSDebug.h:204
static void addPos(long)
Definition: WPSDebug.h:209
static void addNote(char const *)
Definition: WPSDebug.h:210
static void setStream(RVNGInputStreamPtr)
Definition: WPSDebug.h:201
static void addDelimiter(long, char)
Definition: WPSDebug.h:211
static void skipZone(long, long)
Definition: WPSDebug.h:215
static void str(std::string const &)
Definition: WPSDebug.h:193
shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
shared pointer to librevenge::RVNGInputStream
Definition: libwps_internal.h:81
~DebugFile()
Definition: WPSDebug.h:202
bool dumpFile(librevenge::RVNGBinaryData &, char const *)
Definition: WPSDebug.h:169
DebugStream & operator<<(T const &)
Definition: WPSDebug.h:184
DebugFile()
Definition: WPSDebug.h:200
DebugFile(RVNGInputStreamPtr)
Definition: WPSDebug.h:199
std::string flattenFileName(std::string const &name)
Definition: WPSDebug.h:174
small class which defines a vector with 2 elements
Definition: libwps_internal.h:304