43 # if defined(DEBUG_WITH_FILES)
57 bool dumpFile(WPXBinaryData &data,
char const *fileName);
83 bool open(std::string
const &filename);
136 if (diff)
return (diff < 0) ?
true :
false;
152 typedef std::map<NotePos, int,struct NotePosLt>
Map;
168 inline bool dumpFile(WPXBinaryData &,
char const *)
187 static std::string str() {
188 return std::string(
"");
190 static void str(std::string
const &) { }
201 static bool open(std::string
const &) {
205 static void addPos(
long ) {}
206 static void addNote(
char const *) {}
209 static void write() {}
210 static void reset() { }
212 static void skipZone(
long ,
long ) {}
void skipZone(long beginPos, long endPos)
skips the file zone defined by beginPos-endPos
Definition: MWAWDebug.hxx:103
void write()
flushes the file
Definition: MWAWDebug.cxx:111
NotePos(long p, std::string const &n, bool br=true)
constructor: given position and note
Definition: MWAWDebug.hxx:125
void setStream(MWAWInputStreamPtr ip)
resets the input
Definition: MWAWDebug.hxx:75
an interface used to insert comment in a binary file, written in ascii form (if debug_with_files is n...
Definition: MWAWDebug.hxx:67
void sort()
sorts the position/note date
Definition: MWAWDebug.cxx:82
std::ostream & operator<<(std::ostream &o, PrinterInfo const &r)
operator<< for a PrinterInfo
Definition: MWAWPrinter.cxx:203
a note and its position (used to sort all notes)
Definition: MWAWDebug.hxx:120
bool operator<(NotePos const &p) const
comparison operator based on the position
Definition: MWAWDebug.hxx:134
bool m_breaking
flag to indicate a non breaking note
Definition: MWAWDebug.hxx:131
long m_actOffset
the actual offset (used to store note)
Definition: MWAWDebug.hxx:156
std::string m_text
note text
Definition: MWAWDebug.hxx:129
bool open(std::string const &filename)
opens/creates a file to store a result
Definition: MWAWDebug.cxx:45
void addDelimiter(long pos, char c)
adds a not breaking delimiter in position pos
Definition: MWAWDebug.cxx:74
void addPos(long pos)
adds a new position in the file
Definition: MWAWDebug.cxx:53
std::vector< NotePos > m_notes
list of notes
Definition: MWAWDebug.hxx:158
internal struct used to sort the notes, sorted by position
Definition: MWAWDebug.hxx:143
NotePos()
empty constructor used by std::vector
Definition: MWAWDebug.hxx:122
std::map< NotePos, int, struct NotePosLt > Map
map of notes
Definition: MWAWDebug.hxx:152
~DebugFile()
destructor
Definition: MWAWDebug.hxx:79
shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:336
MWAWInputStreamPtr m_input
the input
Definition: MWAWDebug.hxx:117
std::ofstream m_file
a stream which is open to write the file
Definition: MWAWDebug.hxx:112
std::string flattenFileName(std::string const &name)
returns a file name from an ole/... name
Definition: MWAWDebug.cxx:205
void reset()
writes the current file and reset to zero
Definition: MWAWDebug.hxx:85
std::vector< Vec2< long > > m_skipZones
list of skipZone
Definition: MWAWDebug.hxx:160
std::stringstream DebugStream
a basic stream (if debug_with_files is not defined, does nothing)
Definition: MWAWDebug.hxx:63
long m_pos
note offset
Definition: MWAWDebug.hxx:127
m_skipZones()
Definition: MWAWDebug.hxx:72
bool m_on
a flag to know if the result stream is open or note
Definition: MWAWDebug.hxx:114
bool dumpFile(WPXBinaryData &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:190
bool operator()(NotePos const &s1, NotePos const &s2) const
comparison operator
Definition: MWAWDebug.hxx:145
void addNote(char const *note)
adds a note in the file, in actual position
Definition: MWAWDebug.cxx:59