#include <ngsentry.h>
Inheritance diagram for NodeSetProperty:
Public Member Functions | |
NodeSetProperty () | |
Default constructor for a NodeSetProperty, a container node for a group of properties for a named set. | |
NodeSetProperty (const StringBase &strName) | |
Constructor for a NodeSetProperty, a container of properties associated with particular SGNameItems. | |
virtual | ~NodeSetProperty () |
Destroys a NodeSetProperty. | |
const StringBase & | GetName () const |
virtual SGNameProp * | SetProperty (SGNameProp *pNewProp) |
See Node::GetNodeSize. | |
SGNameProp * | GetProperty (INT32 nIndex) const |
BOOL | CreateDefaults () |
Create default properties of every type for this set. | |
BOOL | CopyProperties (NodeSetProperty *pOther) |
Copy the given NodeSetProperty's SGNameProps into this. | |
virtual Node * | SimpleCopy () |
See Node::SimpleCopy. | |
virtual void | PolyCopyNodeContents (NodeRenderable *pNodeCopy) |
Polymorphically copies the contents of this node to another. | |
Public Attributes | |
BOOL | m_Imported |
Protected Member Functions | |
virtual UINT32 | GetNodeSize () const |
See Node::GetNodeSize. | |
void | CopyNodeContents (NodeSetProperty *pCopy) |
See Node::SimpleCopy. | |
virtual BOOL | WritePreChildrenNative (BaseCamelotFilter *) |
Writes out a SetProperty record. | |
virtual BOOL | CanWriteChildrenWeb (BaseCamelotFilter *) |
Prevents children of the sentinel being written out in the web format. | |
virtual BOOL | WritePreChildrenWeb (BaseCamelotFilter *) |
Web files don't write out SetSentinel records. This code assumes the document will only contain one SetSentinel. | |
virtual BOOL | WriteBeginChildRecordsWeb (BaseCamelotFilter *) |
Begins the child record sequence for SetSentinel in the web format. Web export doesn't write out SetSentinel records or children of the sentinel, so this overrides the default behaviour in Node by ensuring the DOWN record does not get written. | |
virtual BOOL | WriteEndChildRecordsWeb (BaseCamelotFilter *) |
Ends the child record sequence for SetSentinel in the web format. Web export doesn't write out SetSentinel records or children of the sentinel, so this overrides the default behaviour in Node by ensuring the UP record does not get written. | |
Private Member Functions | |
CC_DECLARE_DYNAMIC (NodeSetProperty) | |
Private Attributes | |
StringBase | m_strName |
SGNameProp * | m_pProp [SGNameProp::nPropertyCount] |
Definition at line 125 of file ngsentry.h.
|
Default constructor for a NodeSetProperty, a container node for a group of properties for a named set.
Definition at line 152 of file ngsentry.cpp. 00153 { 00154 memset(m_pProp, 0, sizeof(m_pProp)); 00155 m_Imported = FALSE; 00156 }
|
|
Constructor for a NodeSetProperty, a container of properties associated with particular SGNameItems.
Definition at line 172 of file ngsentry.cpp. 00173 { 00174 memset(m_pProp, 0, sizeof(m_pProp)); 00175 m_strName.Alloc(strName.Length() + 1); 00176 m_strName = strName; 00177 m_Imported = FALSE; 00178 }
|
|
Destroys a NodeSetProperty.
Definition at line 191 of file ngsentry.cpp. 00192 { 00193 // If we still have valid pointers to properties then take responsibility for 00194 // deallocating them. 00195 for (SGNameProp** ppProp = &m_pProp[SGNameProp::nPropertyCount]; 00196 --ppProp >= &m_pProp[0]; /* empty */ ) 00197 if (*ppProp != 0) 00198 { 00199 delete *ppProp; 00200 *ppProp = 0; 00201 } 00202 }
|
|
Prevents children of the sentinel being written out in the web format.
Reimplemented from Node. Definition at line 446 of file ngsentry.cpp. 00447 { 00448 return FALSE; 00449 }
|
|
|
|
See Node::SimpleCopy.
Definition at line 340 of file ngsentry.cpp. 00341 { 00342 ERROR3IF(pCopy == 0, "NodeSetProperty::CopyNodeContents: null input"); 00343 Node::CopyNodeContents(pCopy); 00344 00345 // Copy the name of the set. 00346 pCopy->m_strName.Alloc(m_strName.Length() + 1); 00347 pCopy->m_strName = m_strName; 00348 00349 // Create copies in the heap of this node's contained properties. 00350 for (INT32 i = 0; i < SGNameProp::nPropertyCount; i++) 00351 { 00352 if (m_pProp[i] == 0) 00353 pCopy->m_pProp[i] = 0; 00354 else 00355 { 00356 // TODO: verify that this is the out of memory convention for this func. 00357 pCopy->m_pProp[i] = m_pProp[i]->Clone(); 00358 if (pCopy->m_pProp[i] == 0) 00359 { 00360 ERROR1RAW(_R(IDE_NOMORE_MEMORY)); 00361 return; 00362 } 00363 } 00364 } 00365 }
|
|
Copy the given NodeSetProperty's SGNameProps into this.
Definition at line 270 of file ngsentry.cpp. 00271 { 00272 // Replace properties in this with clones of the other's. 00273 for (INT32 i = 0; i < SGNameProp::nPropertyCount; i++) 00274 { 00275 SGNameProp* pNewProp; 00276 if (pOther->m_pProp[i] == 0) 00277 pNewProp = 0; 00278 else 00279 { 00280 pNewProp = pOther->m_pProp[i]->Clone(); 00281 ERRORIF(pNewProp == 0, _R(IDE_NOMORE_MEMORY), FALSE); 00282 } 00283 00284 delete m_pProp[i]; 00285 m_pProp[i] = pNewProp; 00286 } 00287 00288 return TRUE; 00289 }
|
|
Create default properties of every type for this set.
Definition at line 244 of file ngsentry.cpp. 00245 { 00246 // Create a new default property of every type and delete any old ones. 00247 for (INT32 i = 0; i < SGNameProp::nPropertyCount; i++) 00248 { 00249 if (m_pProp[i] != 0) delete m_pProp[i]; 00250 m_pProp[i] = SGNameProp::CreateDefault(m_strName, i); 00251 if (m_pProp[i] == 0) return FALSE; 00252 } 00253 00254 return TRUE; 00255 }
|
|
Definition at line 135 of file ngsentry.h. 00136 { return m_strName; }
|
|
See Node::GetNodeSize.
Reimplemented from Node. Definition at line 302 of file ngsentry.cpp.
|
|
Definition at line 140 of file ngsentry.h. 00141 { return m_pProp[nIndex]; }
|
|
Polymorphically copies the contents of this node to another.
Definition at line 380 of file ngsentry.cpp. 00381 { 00382 ENSURE(pNodeCopy, "Trying to copy a node's contents into a NULL node"); 00383 ENSURE(IS_A(pNodeCopy, NodeSetProperty), "PolyCopyNodeContents given wrong dest node type"); 00384 00385 if (IS_A(pNodeCopy, NodeSetProperty)) 00386 CopyNodeContents((NodeSetProperty*)pNodeCopy); 00387 }
|
|
See Node::GetNodeSize.
Definition at line 217 of file ngsentry.cpp. 00218 { 00219 ERROR3IF(pNewProp == 0, "NodeSetProperty::SetProperty: null input"); 00220 00221 INT32 i = pNewProp->GetIndex(); 00222 ERROR3IF(i < 0 || i >= SGNameProp::nPropertyCount, 00223 "NodeSetProperty::SetProperty: out of range"); 00224 00225 SGNameProp* pOld = m_pProp[i]; 00226 m_pProp[i] = pNewProp; 00227 00228 m_Imported = FALSE; 00229 return pOld; 00230 }
|
|
See Node::SimpleCopy.
Reimplemented from Node. Definition at line 321 of file ngsentry.cpp. 00322 { 00323 NodeSetProperty* pCopy = new NodeSetProperty; 00324 ERRORIF(pCopy == 0, _R(IDE_NOMORE_MEMORY), 0); 00325 CopyNodeContents(pCopy); 00326 return pCopy; 00327 }
|
|
Begins the child record sequence for SetSentinel in the web format. Web export doesn't write out SetSentinel records or children of the sentinel, so this overrides the default behaviour in Node by ensuring the DOWN record does not get written.
Reimplemented from Node. Definition at line 484 of file ngsentry.cpp. 00485 { 00486 return TRUE; 00487 }
|
|
Ends the child record sequence for SetSentinel in the web format. Web export doesn't write out SetSentinel records or children of the sentinel, so this overrides the default behaviour in Node by ensuring the UP record does not get written.
Reimplemented from Node. Definition at line 504 of file ngsentry.cpp. 00505 { 00506 return TRUE; 00507 }
|
|
Writes out a SetProperty record.
Reimplemented from Node. Definition at line 401 of file ngsentry.cpp. 00402 { 00403 #ifdef DO_EXPORT 00404 // Write out the SetProperty record header. 00405 CXaraFileRecord rec(TAG_SETPROPERTY, TAG_SETPROPERTY_SIZE); 00406 if (!rec.Init() || 00407 !rec.WriteUnicode(m_strName) || 00408 !rec.WriteINT16((INT16) SGNameProp::nPropertyCount)) 00409 { 00410 pFilter->GotError(_R(IDE_FILE_WRITE_ERROR)); 00411 return FALSE; 00412 } 00413 00414 // Write out each property in ascending index order. 00415 for (INT32 i = 0; i < SGNameProp::nPropertyCount; i++) 00416 { 00417 ERROR3IF(m_pProp[i] == NULL, "NodeSetProperty::WritePreChildrenNative: no property"); 00418 if (!rec.WriteINT16((INT16) i) || !m_pProp[i]->Write(&rec)) 00419 { 00420 pFilter->GotError(_R(IDE_FILE_WRITE_ERROR)); 00421 return FALSE; 00422 } 00423 } 00424 00425 // We've built up a record, now write it out. 00426 UINT32 r = pFilter->Write(&rec); 00427 if (r == 0) pFilter->GotError(_R(IDE_FILE_WRITE_ERROR)); 00428 return (BOOL) r; 00429 #else 00430 return FALSE; 00431 #endif 00432 }
|
|
Web files don't write out SetSentinel records. This code assumes the document will only contain one SetSentinel.
Reimplemented from Node. Definition at line 464 of file ngsentry.cpp. 00465 { 00466 return FALSE; 00467 }
|
|
Definition at line 173 of file ngsentry.h. |
|
Definition at line 169 of file ngsentry.h. |
|
Definition at line 168 of file ngsentry.h. |