41 # if defined(DEBUG_WITH_FILES)
55 bool dumpFile(librevenge::RVNGBinaryData &data,
char const *fileName);
61 typedef std::stringstream DebugStream;
70 : m_fileName(
""), m_file(), m_on(false), m_input(ip), m_actOffset(-1), m_notes(), m_skipZones() { }
83 bool open(std::string
const &filename);
92 m_skipZones.resize(0);
100 void addNote(
char const *note);
105 void skipZone(
long beginPos,
long endPos)
115 mutable std::string m_fileName;
117 mutable std::ofstream m_file;
127 NotePos() : m_pos(-1), m_text(
""), m_breaking(false) { }
130 NotePos(
long p, std::string
const &n,
bool br=
true) : m_pos(p), m_text(n), m_breaking(br) {}
139 bool operator<(NotePos
const &p)
const
141 long diff = m_pos-p.m_pos;
142 if (diff)
return (diff < 0) ?
true :
false;
143 if (m_breaking != p.m_breaking)
return m_breaking;
144 return m_text < p.m_text;
151 bool operator()(NotePos
const &s1, NotePos
const &s2)
const
161 std::vector<NotePos> m_notes;
163 std::vector<STOFFVec2<long> > m_skipZones;
171 inline bool dumpFile(librevenge::RVNGBinaryData &,
char const *)
193 return std::string(
"");
195 static void str(std::string
const &) { }
206 static bool open(std::string
const &)
static void addDelimiter(long, char)
Definition: STOFFDebug.hxx:213
shared_ptr< STOFFInputStream > STOFFInputStreamPtr
a smart pointer of STOFFInputStream
Definition: libstaroffice_internal.hxx:488
static void write()
Definition: STOFFDebug.hxx:215
Definition: STOFFDebug.hxx:198
small class which defines a vector with 2 elements
Definition: libstaroffice_internal.hxx:587
static void addPos(long)
Definition: STOFFDebug.hxx:211
DebugFile()
Definition: STOFFDebug.hxx:202
bool dumpFile(librevenge::RVNGBinaryData &, char const *)
Definition: STOFFDebug.hxx:171
static void reset()
Definition: STOFFDebug.hxx:216
DebugStream & operator<<(T const &)
Definition: STOFFDebug.hxx:186
~DebugFile()
Definition: STOFFDebug.hxx:204
std::string flattenFileName(std::string const &name)
returns a file name from an ole/... name
Definition: STOFFDebug.hxx:176
DebugFile(STOFFInputStreamPtr)
Definition: STOFFDebug.hxx:201
static void str(std::string const &)
Definition: STOFFDebug.hxx:195
static std::string str()
Definition: STOFFDebug.hxx:191
static void skipZone(long, long)
Definition: STOFFDebug.hxx:218
static void setStream(STOFFInputStreamPtr)
Definition: STOFFDebug.hxx:203
Definition: STOFFDebug.hxx:182
static void addNote(char const *)
Definition: STOFFDebug.hxx:212
static bool open(std::string const &)
Definition: STOFFDebug.hxx:206