NLSOUND::CSoundGroupSerializer Class Reference


Public Member Functions

void readGeorges (const NLMISC::CSmartPtr< NLGEORGES::UForm > &form, const std::string &name)
void removed ()
void serial (NLMISC::IStream &s)

Static Public Member Functions

uint getVersion ()

Data Fields

std::vector< std::pair< NLMISC::TStringId,
NLMISC::TStringId > > 
_SoundGroupAssoc

Member Function Documentation

uint NLSOUND::CSoundGroupSerializer::getVersion  )  [inline, static]
 

Definition at line 214 of file clustered_sound.cpp.

References uint.

00214 { return 1; }

void NLSOUND::CSoundGroupSerializer::readGeorges const NLMISC::CSmartPtr< NLGEORGES::UForm > &  form,
const std::string &  name
[inline]
 

Definition at line 131 of file clustered_sound.cpp.

References _SoundGroupAssoc, NLGEORGES::UFormElm::getArrayNode(), NLGEORGES::UFormElm::getArraySize(), NLGEORGES::UFormElm::getNodeByName(), NLGEORGES::UFormElm::getValueByName(), size, and uint.

00132         {
00133                 try
00134                 {
00135                         NLGEORGES::UFormElm &root = form->getRootNode();
00136                         NLGEORGES::UFormElm *items;
00137                         uint size;
00138                         root.getNodeByName(&items, ".Items");
00139                         items->getArraySize(size);
00140 
00141                         for (uint i=0; i<size; ++i)
00142                         {
00143                                 std::string soundGroup;
00144                                 std::string sound;
00145 
00146                                 NLGEORGES::UFormElm *item;
00147 
00148                                 items->getArrayNode(&item, i);
00149 
00150                                 item->getValueByName(soundGroup, ".SoundGroup");
00151                                 item->getValueByName(sound, ".Sound");
00152 
00153                                 string::size_type n = sound.rfind(".sound");
00154 
00155                                 if (n != string::npos)
00156                                 {
00157                                         // remove the tailing .sound
00158                                         sound = sound.substr(0, n);
00159                                 }
00160 
00161                                 _SoundGroupAssoc.push_back(make_pair(CStringMapper::map(soundGroup), CStringMapper::map(sound)));
00162                         }
00163                 }
00164                 catch(...)
00165                 {
00166                 }
00167         }

void NLSOUND::CSoundGroupSerializer::removed  )  [inline]
 

called by GEORGE::loadForm when a sheet read from the packed sheet is no more in the directories.

Definition at line 208 of file clustered_sound.cpp.

00209         {
00210                 // nothing to do
00211         }

void NLSOUND::CSoundGroupSerializer::serial NLMISC::IStream s  )  [inline]
 

Definition at line 170 of file clustered_sound.cpp.

References _SoundGroupAssoc, s, size, uint, and uint32.

00171         {
00172                 uint32 size;
00173                 if (!s.isReading())
00174                 {
00175                         size = _SoundGroupAssoc.size();
00176                 }
00177                 s.serial(size);
00178 
00179                 for (uint i=0; i<size; ++i)
00180                 {
00181                         if (s.isReading())
00182                         {
00183                                 std::string soundGroup;
00184                                 std::string sound;
00185 
00186                                 s.serial(soundGroup);
00187                                 s.serial(sound);
00188 
00189                                 _SoundGroupAssoc.push_back(make_pair(CStringMapper::map(soundGroup), CStringMapper::map(sound)));
00190                         }
00191                         else
00192                         {
00193                                 std::string soundGroup;
00194                                 std::string sound;
00195 
00196                                 soundGroup = CStringMapper::unmap(_SoundGroupAssoc[i].first);
00197                                 sound = CStringMapper::unmap(_SoundGroupAssoc[i].second);
00198 
00199                                 s.serial(soundGroup);
00200                                 s.serial(sound);
00201                         }
00202                 }
00203         }


Field Documentation

std::vector<std::pair<NLMISC::TStringId, NLMISC::TStringId> > NLSOUND::CSoundGroupSerializer::_SoundGroupAssoc
 

Definition at line 128 of file clustered_sound.cpp.

Referenced by readGeorges(), and serial().


The documentation for this class was generated from the following file:
Generated on Tue Mar 16 14:44:41 2004 for NeL by doxygen 1.3.6