VR-Forces 5.0.3 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
translatableStream.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2022 MAK Technologies, Inc.
3  * All rights reserved.
4  ****************************************************************************/
5 
9 
10 #pragma once
11 
16 
17 class DtLocalObject;
18 class DtOutputStream;
19 
23  : public DtAsciiSerializable
24 #ifdef DtObjectDebugger_Enable
25  , public DtObjectDebugger<DtTranslatableStream>
26 #endif
27 {
28 public:
29 
30  DtTranslatableStream( DtLocalObject* const obj );
31  DtTranslatableStream( const char* message, const char* module );
33 
34  virtual ~DtTranslatableStream();
35 
37  virtual void printWarn();
38  virtual void printError();
39  virtual void printInfo();
40  virtual void printDebug();
41  virtual void printVerbose();
42 
44  virtual void addTranslatableString( const std::string& format, const std::string& module );
45 
47  virtual DtTranslatableStream& argString( const std::string& argument );
48  virtual DtTranslatableStream& argNumber( double argument );
49  virtual DtTranslatableStream& arg( const std::string& argument ) { return argString( argument ); };
50  virtual DtTranslatableStream& arg( const DtString& argument ) { return argString( argument.c_str() ); };
51  virtual DtTranslatableStream& arg( const char* argument ) { return argString( std::string( argument ) ); };
52  virtual DtTranslatableStream& arg( double argument ) { return argNumber( argument ); };
53 
55  static DtAsciiSerializable* creator();
56 
58  virtual void printTo( DtOutputStream& ) const;
59 
60  virtual std::string toStdString() const;
61 
62  static DtTranslatableStream trUtf8( const char* fmt )
63  {
64  return DtTranslatableStream( fmt, "BackEndTranslatableString" );
65  }
66 
67  static DtTranslatableStream tr( const char* fmt, const char* module )
68  {
69  return DtTranslatableStream( fmt, module );
70  }
71 
73  {
74  return myTranslatableStrings;
75  }
76 
77 protected:
78 
79  virtual DtString objectType() const;
80 
83 
86  bool deserialize( const DtString& data );
87 
88 protected:
89 
92 
93 };
94 
95 
96 DT_DLL_vrfobjcore DtOutputStream& operator << ( DtOutputStream& str, const DtTranslatableStream& );
97 
98 
virtual DtTranslatableStream & arg(const char *argument)
Definition: translatableStream.h:51
Definition: asciiSerializable.h:34
virtual bool deserialize(const DtString &)=0
This function should take the string that was serialized via serialize() and fill this object with th...
DtScriptOwnshipObject myVrfObject
Definition: translatableStream.h:91
#define DT_DEFINE_OBJECT_DEBUGGER_NAME(type)
Definition: objectCounter.h:265
Default on in debug, off in release.
Definition: objectCounter.h:31
Contains the DtRwTranslatableStringObject class declaration.
DT_DLL_features std::ostream & operator<<(std::ostream &, const DtFeatureTransform &)
std::ostream output.
virtual DtString serialize()=0
The following characters are reserved and cannot be used in serialization: &#39;|&#39;, &#39;:&#39;.
DtRwTranslatableStringObject myTranslatableStrings
Definition: translatableStream.h:90
static DtTranslatableStream trUtf8(const char *fmt)
Definition: translatableStream.h:62
#define DT_DLL_vrfobjcore
This file is used to determine how to build.
Definition: vrfobjcoreDefines.h:24
virtual DtTranslatableStream & arg(const DtString &argument)
Definition: translatableStream.h:50
virtual DtTranslatableStream & arg(const std::string &argument)
Definition: translatableStream.h:49
This stream is used by the scripting classes to be able to send out translatable messages from script...
Definition: translatableStream.h:22
DtRwTranslatableStringObject is a simple class that will keep track of strings that can be translated...
Definition: rwTranslatableStringObject.h:31
virtual DtString objectType() const =0
Should return the string name of this object. The object name should not be part of the serialization...
static DtTranslatableStream tr(const char *fmt, const char *module)
Definition: translatableStream.h:67
const DtRwTranslatableStringObject & translatableStrings() const
Definition: translatableStream.h:72
The &quot;this&quot; version is the own-ship object. It is separated to allow special functions for the ownshi...
Definition: scriptVrfObject.h:385
virtual DtTranslatableStream & arg(double argument)
Definition: translatableStream.h:52
A locally simulated VRF object. Holds all internal and external data for the object, and provides access to both the current frame and next frame state data for the object. All current frame data is read-only, and next-frame data can be written to. No thread safety guarantees are made on this object during the simulation frame and it should only be accessed by the thread that is simulating the object.
Definition: localObject.h:86

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)