OpenBarnyard
 
Loading...
Searching...
No Matches
PBPropertyValueArray Class Reference

#include <PBProperties.h>

Public Member Functions

 PBPropertyValueArray ()
 
 PBPropertyValueArray (const PBPropertyValueArray &other)
 
 PBPropertyValueArray (PBPropertyValueArray &&other) noexcept
 
 ~PBPropertyValueArray ()
 
PBPropertyValueGetValue (TSIZE a_iIndex)
 
const PBPropertyValueGetValue (TSIZE a_iIndex) const
 
TUINT32 GetSize () const
 
PBPropertyValueAdd (TINT a_iValue)
 
PBPropertyValueAdd (TBOOL a_bValue)
 
PBPropertyValueAdd (TFLOAT a_fValue)
 
PBPropertyValueAdd (TUINT32 a_uiValue)
 
PBPropertyValueAdd (PBPropertyLocaleString a_strLocaleString)
 
PBPropertyValueAdd (const Toshi::TString8 &a_sValue)
 
PBPropertyValueAdd (const TCHAR *a_pchValue)
 
PBPropertyValueoperator[] (TSIZE a_iIndex)
 
const PBPropertyValueoperator[] (TSIZE a_iIndex) const
 
PBPropertyValueArrayoperator= (const PBPropertyValueArray &other)
 
PBPropertyValueArrayoperator= (PBPropertyValueArray &&other) noexcept
 

Friends

class PPropertiesWriter
 

Detailed Description

Definition at line 413 of file PBProperties.h.

Constructor & Destructor Documentation

◆ PBPropertyValueArray() [1/3]

PBPropertyValueArray::PBPropertyValueArray ( )
inline

Definition at line 419 of file PBProperties.h.

420 {
421 m_pValues = TNULL;
422 m_iSize = 0;
423 }
#define TNULL
Definition Typedefs.h:23

◆ PBPropertyValueArray() [2/3]

PBPropertyValueArray::PBPropertyValueArray ( const PBPropertyValueArray & other)
inline

Definition at line 425 of file PBProperties.h.

426 {
427 if ( other.m_iSize != 0 )
428 {
429 m_pValues = new PBPropertyValue[ other.m_iSize ];
430
431 for ( TSIZE i = 0; i < other.m_iSize; i++ )
432 m_pValues[ i ] = other.m_pValues[ i ];
433 }
434 else
435 {
436 m_pValues = TNULL;
437 }
438
439 m_iSize = other.m_iSize;
440 }
size_t TSIZE
Definition Typedefs.h:9

◆ PBPropertyValueArray() [3/3]

PBPropertyValueArray::PBPropertyValueArray ( PBPropertyValueArray && other)
inlinenoexcept

Definition at line 442 of file PBProperties.h.

443 {
444 m_pValues = other.m_pValues;
445 m_iSize = other.m_iSize;
446 other.m_pValues = TNULL;
447 other.m_iSize = 0;
448 }

◆ ~PBPropertyValueArray()

PBPropertyValueArray::~PBPropertyValueArray ( )
inline

Definition at line 450 of file PBProperties.h.

451 {
452 Delete();
453 }

Member Function Documentation

◆ Add() [1/7]

PBPropertyValue * PBPropertyValueArray::Add ( const TCHAR * a_pchValue)
inline

Definition at line 502 of file PBProperties.h.

503 {
504 return AllocValue( PBPropertyValue( a_pchValue ) );
505 }

◆ Add() [2/7]

PBPropertyValue * PBPropertyValueArray::Add ( const Toshi::TString8 & a_sValue)
inline

Definition at line 497 of file PBProperties.h.

498 {
499 return AllocValue( PBPropertyValue( a_sValue ) );
500 }

◆ Add() [3/7]

PBPropertyValue * PBPropertyValueArray::Add ( PBPropertyLocaleString a_strLocaleString)
inline

Definition at line 492 of file PBProperties.h.

493 {
494 return AllocValue( PBPropertyValue( a_strLocaleString ) );
495 }

◆ Add() [4/7]

PBPropertyValue * PBPropertyValueArray::Add ( TBOOL a_bValue)
inline

Definition at line 477 of file PBProperties.h.

478 {
479 return AllocValue( PBPropertyValue( a_bValue ) );
480 }

◆ Add() [5/7]

PBPropertyValue * PBPropertyValueArray::Add ( TFLOAT a_fValue)
inline

Definition at line 482 of file PBProperties.h.

483 {
484 return AllocValue( PBPropertyValue( a_fValue ) );
485 }

◆ Add() [6/7]

PBPropertyValue * PBPropertyValueArray::Add ( TINT a_iValue)
inline

Definition at line 472 of file PBProperties.h.

473 {
474 return AllocValue( PBPropertyValue( a_iValue ) );
475 }

◆ Add() [7/7]

PBPropertyValue * PBPropertyValueArray::Add ( TUINT32 a_uiValue)
inline

Definition at line 487 of file PBProperties.h.

488 {
489 return AllocValue( PBPropertyValue( a_uiValue ) );
490 }

◆ GetSize()

TUINT32 PBPropertyValueArray::GetSize ( ) const
inline

Definition at line 467 of file PBProperties.h.

468 {
469 return m_iSize;
470 }

◆ GetValue() [1/2]

PBPropertyValue * PBPropertyValueArray::GetValue ( TSIZE a_iIndex)
inline

Definition at line 455 of file PBProperties.h.

456 {
457 TASSERT( m_iSize > a_iIndex );
458 return &m_pValues[ a_iIndex ];
459 }
#define TASSERT(X,...)
Definition Defines.h:138

◆ GetValue() [2/2]

const PBPropertyValue * PBPropertyValueArray::GetValue ( TSIZE a_iIndex) const
inline

Definition at line 461 of file PBProperties.h.

462 {
463 TASSERT( m_iSize > a_iIndex );
464 return &m_pValues[ a_iIndex ];
465 }

◆ operator=() [1/2]

PBPropertyValueArray & PBPropertyValueArray::operator= ( const PBPropertyValueArray & other)
inline

Definition at line 517 of file PBProperties.h.

518 {
519 if ( this != &other )
520 {
521 Delete();
522
523 if ( other.m_iSize != 0 )
524 {
525 m_pValues = new PBPropertyValue[ other.m_iSize ];
526
527 for ( TSIZE i = 0; i < other.m_iSize; i++ )
528 m_pValues[ i ] = other.m_pValues[ i ];
529
530 m_iSize = other.m_iSize;
531 }
532 }
533 }

◆ operator=() [2/2]

PBPropertyValueArray & PBPropertyValueArray::operator= ( PBPropertyValueArray && other)
inlinenoexcept

Definition at line 535 of file PBProperties.h.

536 {
537 if ( this != &other )
538 {
539 Delete();
540
541 m_pValues = other.m_pValues;
542 m_iSize = other.m_iSize;
543 other.m_pValues = TNULL;
544 other.m_iSize = 0;
545 }
546 }

◆ operator[]() [1/2]

PBPropertyValue * PBPropertyValueArray::operator[] ( TSIZE a_iIndex)
inline

Definition at line 507 of file PBProperties.h.

508 {
509 return GetValue( a_iIndex );
510 }
PBPropertyValue * GetValue(TSIZE a_iIndex)

◆ operator[]() [2/2]

const PBPropertyValue * PBPropertyValueArray::operator[] ( TSIZE a_iIndex) const
inline

Definition at line 512 of file PBProperties.h.

513 {
514 return GetValue( a_iIndex );
515 }

Friends And Related Symbol Documentation

◆ PPropertiesWriter

friend class PPropertiesWriter
friend

Definition at line 416 of file PBProperties.h.


The documentation for this class was generated from the following file: