41 # if defined(DEBUG_WITH_FILES) 55 bool dumpFile(librevenge::RVNGBinaryData &data,
char const *fileName);
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);
98 void addPos(
long pos);
100 void addNote(
char const *note);
102 void addDelimiter(
long pos,
char c);
107 if (m_on) m_skipZones.push_back(
MWAWVec2<long>(beginPos, endPos));
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) {}
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;
171 inline bool dumpFile(librevenge::RVNGBinaryData &,
char const *)
191 static std::string str()
193 return std::string(
"");
195 static void str(std::string
const &) { }
206 static bool open(std::string
const &)
211 static void addPos(
long) {}
212 static void addNote(
char const *) {}
213 static void addDelimiter(
long,
char) {}
215 static void write() {}
216 static void reset() { }
218 static void skipZone(
long ,
long) {}
void skipZone(long beginPos, long endPos)
skips the file zone defined by beginPos-endPos
Definition: MWAWDebug.hxx:105
DebugFile(MWAWInputStreamPtr ip)
constructor given the input file
Definition: MWAWDebug.hxx:69
bool operator()(NotePos const &s1, NotePos const &s2) const
comparison operator
Definition: MWAWDebug.hxx:151
NotePos(long p, std::string const &n, bool br=true)
constructor: given position and note
Definition: MWAWDebug.hxx:130
void setStream(MWAWInputStreamPtr ip)
resets the input
Definition: MWAWDebug.hxx:73
an interface used to insert comment in a binary file, written in ascii form (if debug_with_files is n...
Definition: MWAWDebug.hxx:65
std::string m_fileName
the file name
Definition: MWAWDebug.hxx:115
std::ostream & operator<<(std::ostream &o, PrinterInfo const &r)
operator<< for a PrinterInfo
Definition: MWAWPrinter.cxx:211
a note and its position (used to sort all notes)
Definition: MWAWDebug.hxx:125
namespace used to regroup all libwpd functions, enumerations which we have redefined for internal usa...
Definition: libmwaw_internal.cxx:50
bool dumpFile(librevenge::RVNGBinaryData &data, char const *fileName)
a debug function to store in a datafile in the current directory WARNING: this function erase the fil...
Definition: MWAWDebug.cxx:197
bool m_breaking
flag to indicate a non breaking note
Definition: MWAWDebug.hxx:136
long m_actOffset
the actual offset (used to store note)
Definition: MWAWDebug.hxx:159
bool operator<(NotePos const &p) const
comparison operator based on the position
Definition: MWAWDebug.hxx:139
std::string m_text
note text
Definition: MWAWDebug.hxx:134
std::vector< NotePos > m_notes
list of notes
Definition: MWAWDebug.hxx:161
internal struct used to sort the notes, sorted by position
Definition: MWAWDebug.hxx:149
NotePos()
empty constructor used by std::vector
Definition: MWAWDebug.hxx:127
~DebugFile()
destructor
Definition: MWAWDebug.hxx:78
shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:503
MWAWInputStreamPtr m_input
the input
Definition: MWAWDebug.hxx:122
std::ofstream m_file
a stream which is open to write the file
Definition: MWAWDebug.hxx:117
std::string flattenFileName(std::string const &name)
returns a file name from an ole/... name
Definition: MWAWDebug.cxx:212
void reset()
writes the current file and reset to zero
Definition: MWAWDebug.hxx:85
std::stringstream DebugStream
a basic stream (if debug_with_files is not defined, does nothing)
Definition: MWAWDebug.hxx:61
long m_pos
note offset
Definition: MWAWDebug.hxx:132
std::vector< MWAWVec2< long > > m_skipZones
list of skipZone
Definition: MWAWDebug.hxx:163
bool m_on
a flag to know if the result stream is open or note
Definition: MWAWDebug.hxx:119