37#ifndef WRITE_NOW_ENTRY
38# define WRITE_NOW_ENTRY
54 for (
auto &val :
m_val) val=0;
74 if (entry.
type().length()) {
76 if (entry.
id() >= 0) o <<
"[" << entry.
id() <<
"]";
93 for (
int i = 0; i < 4; i++) {
94 if (entry.
m_val[i]) o <<
"v" << i <<
"=" << std::hex << entry.
m_val[i] << std::dec <<
",";
123 if (!entry.
valid())
return false;
125 MWAW_DEBUG_MSG((
"WriteNowEntryManager:add: an entry for this position already exists\n"));
128 auto it =
m_posMap.insert(std::pair<long, WriteNowEntry>(entry.
begin(), entry)).first;
130 (std::multimap<std::string, WriteNowEntry const *>::value_type(entry.
type(), &(it->second)));
143 std::multimap<std::string, WriteNowEntry const *>
m_typeMap;
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:47
std::string const & type() const
returns the type of the entry
Definition: MWAWEntry.hxx:137
long begin() const
returns the begin offset
Definition: MWAWEntry.hxx:83
int id() const
returns the id
Definition: MWAWEntry.hxx:164
bool valid() const
returns true if the zone length is positive
Definition: MWAWEntry.hxx:99
#define MWAW_DEBUG_MSG(M)
Definition: libmwaw_internal.hxx:129
the manager of the entries
Definition: WriteNowEntry.hxx:106
WriteNowEntryManager()
Definition: WriteNowEntry.hxx:107
std::multimap< std::string, WriteNowEntry const * > m_typeMap
the list of entries
Definition: WriteNowEntry.hxx:143
void reset()
reset the data
Definition: WriteNowEntry.hxx:135
WriteNowEntry get(long pos) const
return an entry for a position
Definition: WriteNowEntry.hxx:112
std::map< long, WriteNowEntry > m_posMap
the list of entries by position
Definition: WriteNowEntry.hxx:141
bool add(WriteNowEntry const &entry)
add a new entry
Definition: WriteNowEntry.hxx:121
class to store entry in a WriteNow document
Definition: WriteNowEntry.hxx:48
friend std::ostream & operator<<(std::ostream &o, WriteNowEntry const &entry)
operator<<
Definition: WriteNowEntry.hxx:72
~WriteNowEntry() final
destructor
Definition: WriteNowEntry.cxx:36
int m_fileType
the file entry id
Definition: WriteNowEntry.hxx:100
bool isZone() const
returns true if this is a zone
Definition: WriteNowEntry.hxx:67
bool isZoneType() const
returns true if this entry store a zone
Definition: WriteNowEntry.hxx:62
WriteNowEntry(WriteNowEntry const &)=default
WriteNowEntry()
construtor
Definition: WriteNowEntry.hxx:50
WriteNowEntry & operator=(WriteNowEntry &&)=default
int m_val[4]
other values
Definition: WriteNowEntry.hxx:102
WriteNowEntry & operator=(WriteNowEntry const &)=default