Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

ResDialogPack Class Reference

Inheritance diagram for ResDialogPack:

Inheritance graph
[legend]
Collaboration diagram for ResDialogPack:

Collaboration graph
[legend]

Detailed Description

Multi-language dialogs pack.

Definition at line 14 of file ResDialogPack.h.

Public Member Functions

virtual const char * getName () const
const DialogfindDialogHard (const std::string &name)
 Try find dialog for current lang or default lang.
const DialogfindDialogSpeech (const std::string &name)
 Try find dialog for lang=speech or default lang.

Protected Member Functions

virtual void unloadRes (Dialog *res)


Member Function Documentation

const Dialog * ResDialogPack::findDialogHard const std::string &  name  ) 
 

Try find dialog for current lang or default lang.

Returns:
dialog or NULL

Definition at line 77 of file ResDialogPack.cpp.

00078 {
00079     std::string lang = OptionAgent::agent()->getParam("lang");
00080     const Dialog *dialog = findDialog(name, lang);
00081     if (NULL == dialog) {
00082         dialog = findDialog(name, Dialog::DEFAULT_LANG);
00083         if (NULL == dialog) {
00084             LOG_WARNING(ExInfo("cannot find dialog")
00085                     .addInfo("name", name)
00086                     .addInfo("lang", lang)
00087                     .addInfo("pack", toString()));
00088         }
00089     }
00090 
00091     return dialog;
00092 }

const Dialog * ResDialogPack::findDialogSpeech const std::string &  name  ) 
 

Try find dialog for lang=speech or default lang.

Returns:
dialog or NULL

Definition at line 99 of file ResDialogPack.cpp.

00100 {
00101     std::string speech = OptionAgent::agent()->getParam("speech",
00102             OptionAgent::agent()->getParam("lang"));
00103     const Dialog *dialog = findDialog(name, speech);
00104     if (NULL == dialog || dialog->isSpeechless()) {
00105         dialog = findDialog(name, Dialog::DEFAULT_LANG);
00106         if (NULL == dialog) {
00107             LOG_WARNING(ExInfo("cannot find speech")
00108                     .addInfo("name", name)
00109                     .addInfo("speech", speech)
00110                     .addInfo("pack", toString()));
00111         }
00112     }
00113 
00114     return dialog;
00115 }

virtual const char* ResDialogPack::getName  )  const [inline, virtual]
 

Implements INamed.

Definition at line 23 of file ResDialogPack.h.

00023 { return "dialog_pack"; }

void ResDialogPack::unloadRes Dialog res  )  [protected, virtual]
 

Implements ResourcePack< Dialog * >.

Definition at line 18 of file ResDialogPack.cpp.

00019 {
00020     delete res;
00021 }


The documentation for this class was generated from the following files:
Generated on Wed Jun 1 09:56:25 2005 for Fish Fillets - Next Generation by  doxygen 1.4.2