34 #ifndef RAG_TIME_5_CLUSTER_MANAGER 35 # define RAG_TIME_5_CLUSTER_MANAGER 75 bool sendClusterMainList();
80 bool readCluster(
RagTime5Zone &zone, std::shared_ptr<Cluster> &cluster,
int type=-1);
82 bool readClusterMainList(
ClusterRoot &root, std::vector<int> &list, std::vector<int>
const &clusterIdList);
87 bool readFieldClusters(
Link const &link);
89 bool readUnknownClusterC(
Link const &link);
95 bool getClusterBasicHeaderInfo(
RagTime5Zone &zone,
long &N,
long &fSz,
long &debHeaderPos);
100 bool readFieldHeader(
RagTime5Zone &zone,
long endPos, std::string
const &headerName,
long &endDataPos,
long expectedLVal=-99999);
102 std::string getClusterName(
int id);
123 for (
auto &typ : m_fileType) typ=0;
128 if (m_type==L_LongList && !m_longList.empty())
130 for (
auto id : m_ids)
131 if (
id>0)
return false;
147 s <<
"longList" << m_fieldSize;
151 return "unicodeListLink";
152 case L_UnknownClusterC:
153 return "unknownClusterC";
157 return "fieldsList[unkn]";
163 #if !defined(__clang__) 173 s << std::hex << m_fileType[0] <<
"_" << m_fileType[1] << std::dec;
175 s <<
"_" << m_fieldSize;
182 if (z.
empty())
return o;
184 size_t numLinks=z.
m_ids.size();
185 if (numLinks>1) o <<
"[";
186 for (
size_t i=0; i<numLinks; ++i) {
190 o <<
"data" << z.
m_ids[i] <<
"A";
191 if (i+1!=numLinks) o <<
",";
193 if (numLinks>1) o <<
"]";
195 o <<
"[" << std::hex << z.
m_fieldSize << std::dec <<
":" << z.
m_N <<
"]";
228 C_ChartZone, C_GraphicZone, C_PictureZone, C_SpreadsheetZone,
C_TextZone,
230 C_ColorStyles, C_FormatStyles, C_GraphicStyles, C_TextStyles,
C_UnitStyles,
244 , m_fieldClusterLink()
245 , m_conditionFormulaLinks()
288 , m_graphicTypeLink()
290 , m_listUnicodeLink()
292 , m_listClusterName()
296 for (
auto &
id : m_styleClusterIds)
id=0;
297 for (
auto &
id : m_clusterIds)
id=0;
302 int m_styleClusterIds[8];
364 virtual std::shared_ptr<Cluster> getCluster()=0;
374 s << m_name <<
"-" << n;
410 return (m_hiLoEndian && N==
int(0x80000000)) || (!m_hiLoEndian && N==0x8000);
414 bool readLinkHeader(
MWAWInputStreamPtr &input,
long fSz,
Link &link,
long(&values)[4], std::string &message);
416 std::string getClusterName(
int id);
435 std::shared_ptr<RagTime5ClusterManagerInternal::State>
m_state;
librevenge::RVNGString m_scriptName
the scriptname if known
Definition: RagTime5ClusterManager.hxx:342
virtual int getNewZoneToParse()
returns to new zone to parse.
Definition: RagTime5ClusterManager.hxx:399
RagTime5Parser & m_mainParser
the main parser
Definition: RagTime5ClusterManager.hxx:437
Type m_type
the cluster type
Definition: RagTime5ClusterManager.hxx:255
Definition: RagTime5ClusterManager.hxx:228
Type
the link type
Definition: RagTime5ClusterManager.hxx:107
Cluster(Type type)
constructor
Definition: RagTime5ClusterManager.hxx:237
RagTime5ClusterManager & m_parser
the main parser
Definition: RagTime5ClusterManager.hxx:418
Definition: RagTime5ClusterManager.hxx:230
Definition: RagTime5ClusterManager.hxx:108
ClusterRoot()
constructor
Definition: RagTime5ClusterManager.hxx:286
Link m_linkUnknown
other link: scripts and field 6
Definition: RagTime5ClusterManager.hxx:322
Link m_listUnicodeLink
a link to a list of unknown index+unicode string
Definition: RagTime5ClusterManager.hxx:313
virtual void endZone()
end of a start zone call
Definition: RagTime5ClusterManager.hxx:389
bool m_hiLoEndian
zone endian
Definition: RagTime5ClusterManager.hxx:422
int m_type
the cluster type
Definition: RagTime5ClusterManager.hxx:420
the cluster script ( 2/a/4002/400a zone)
Definition: RagTime5ClusterManager.hxx:329
Link m_graphicTypeLink
the graphic type id
Definition: RagTime5ClusterManager.hxx:308
bool isANameHeader(long N) const
return true if N correspond to a file/script name
Definition: RagTime5ClusterManager.hxx:408
bool m_isSent
true if the cluster was send
Definition: RagTime5ClusterManager.hxx:277
virtual class use to parse the cluster data
Definition: RagTime5ClusterManager.hxx:350
Definition: RagTime5ClusterManager.hxx:109
std::vector< Link > m_conditionFormulaLinks
the conditions formula links
Definition: RagTime5ClusterManager.hxx:269
main zone in a RagTime v5-v6 document
Definition: RagTime5StructManager.hxx:48
Link m_docInfoLink
the doc info link
Definition: RagTime5ClusterManager.hxx:311
Internal: the structures of a RagTime5ClusterManager.
Definition: RagTime5ClusterManager.cxx:48
friend std::ostream & operator<<(std::ostream &o, Link const &z)
operator<<
Definition: RagTime5ClusterManager.hxx:180
librevenge::RVNGString m_fileName
the filename if known
Definition: RagTime5ClusterManager.hxx:325
std::vector< int > m_ids
the data ids
Definition: RagTime5ClusterManager.hxx:205
the cluster for root
Definition: RagTime5ClusterManager.hxx:284
std::string m_name
the link name
Definition: RagTime5ClusterManager.hxx:203
ClusterScript()
constructor
Definition: RagTime5ClusterManager.hxx:331
Definition: RagTime5ClusterManager.hxx:111
bool m_hiLoEndian
the cluster hiLo endian
Definition: RagTime5ClusterManager.hxx:259
Definition: RagTime5ClusterManager.hxx:225
Link(Type type=L_Unknown)
constructor
Definition: RagTime5ClusterManager.hxx:115
ClusterParser(RagTime5ClusterManager &parser, int type, std::string const &zoneName)
constructor
Definition: RagTime5ClusterManager.hxx:352
std::shared_ptr< RagTime5StructManager > m_structManager
the structure manager
Definition: RagTime5ClusterManager.hxx:439
virtual void startZone()
start a new zone
Definition: RagTime5ClusterManager.hxx:380
int m_N
the number of data ( or some flag if m_N & 0x8020)
Definition: RagTime5ClusterManager.hxx:207
Definition: RagTime5ClusterManager.hxx:110
Definition: RagTime5ClusterManager.hxx:224
Link m_listClusterName
the cluster list id name zone link
Definition: RagTime5ClusterManager.hxx:317
basic class used to manage RagTime 5/6 zones
Definition: RagTime5ClusterManager.hxx:58
std::vector< Link > m_linksList
the link list
Definition: RagTime5ClusterManager.hxx:273
Link m_link
the actual link
Definition: RagTime5ClusterManager.hxx:428
virtual bool parseZone(MWAWInputStreamPtr &, long, int, int, libmwaw::DebugStream &)
parse a zone
Definition: RagTime5ClusterManager.hxx:384
Type m_type
the link type
Definition: RagTime5ClusterManager.hxx:201
the main class to read a RagTime v5 file
Definition: RagTime5Parser.hxx:73
int m_fieldSize
the field size
Definition: RagTime5ClusterManager.hxx:209
a field of RagTime 5/6 structures
Definition: RagTime5StructManager.hxx:235
virtual std::string getZoneName() const
return the debug name corresponding to a zone
Definition: RagTime5ClusterManager.hxx:366
std::shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:547
Link m_dataLink
the main data link
Definition: RagTime5ClusterManager.hxx:263
Type
the cluster type
Definition: RagTime5ClusterManager.hxx:223
std::vector< Link > m_settingLinks
the settings links
Definition: RagTime5ClusterManager.hxx:271
int m_listClusterId
the cluster list id
Definition: RagTime5ClusterManager.hxx:315
std::vector< int > m_clusterIdsList
the cluster ids
Definition: RagTime5ClusterManager.hxx:275
librevenge::RVNGString m_name
the cluster name (if know)
Definition: RagTime5ClusterManager.hxx:261
virtual bool parseField(RagTime5StructManager::Field const &, int, libmwaw::DebugStream &)
parse a the data of a zone, n_dataId:m
Definition: RagTime5ClusterManager.hxx:393
std::string m_name
the cluster name
Definition: RagTime5ClusterManager.hxx:424
std::stringstream DebugStream
a basic stream (if debug_with_files is not defined, does nothing)
Definition: MWAWDebug.hxx:61
Link m_scriptComment
the script comment zone
Definition: RagTime5ClusterManager.hxx:340
int m_dataId
the actual zone id
Definition: RagTime5ClusterManager.hxx:426
std::string getZoneName() const
returns the zone name
Definition: RagTime5ClusterManager.hxx:135
Link m_nameLink
the name link
Definition: RagTime5ClusterManager.hxx:265
bool empty() const
returns true if all link are empty
Definition: RagTime5ClusterManager.hxx:126
basic class used to store RagTime 5/6 structures
Definition: RagTime5StructManager.hxx:170
std::shared_ptr< RagTime5ClusterManagerInternal::State > m_state
the state
Definition: RagTime5ClusterManager.hxx:435
Link m_fieldClusterLink
the field cluster links (def and pos)
Definition: RagTime5ClusterManager.hxx:267
virtual std::string getZoneName(int n, int m=-1) const
return the debug name corresponding to a cluster
Definition: RagTime5ClusterManager.hxx:371
int m_zoneId
the zone id
Definition: RagTime5ClusterManager.hxx:257
Definition: RagTime5ClusterManager.hxx:232
a link to a small zone (or set of zones) in RagTime 5/6 documents
Definition: RagTime5ClusterManager.hxx:105
the cluster data
Definition: RagTime5ClusterManager.hxx:221
std::vector< long > m_longList
a list of long used to store decal
Definition: RagTime5ClusterManager.hxx:213