CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
decoder_replacement_fallback.h
1
2#ifndef __DecoderReplacementFallback_h__
3#define __DecoderReplacementFallback_h__
4
5#include "system/string.h"
6#include "system/text/decoder_fallback.h"
7#include "system/exceptions.h"
8
9#include "fwd.h"
10
11namespace System { namespace Text {
12
17class ASPOSECPP_SHARED_CLASS DecoderReplacementFallback
18 : public DecoderFallback
19{
20public:
22 DecoderReplacementFallback() : replacement(u"?") {}
25 DecoderReplacementFallback(const String &replacement_) : replacement(replacement_) {
26 /* ORIG: replacement == null
27 if(replacement.IsEmpty()) {
28 throw ArgumentNullException();
29 }
30 */
31 }
32
33public:
36 const String& get_DefaultString() const { return replacement; }
39 virtual int get_MaxCharCount() const override { return replacement.get_Length(); }
42 virtual ASPOSECPP_SHARED_API DecoderFallbackBufferPtr CreateFallbackBuffer() override;
43
44protected:
46 ASPOSECPP_SHARED_API ~DecoderReplacementFallback() override;
47private:
49 String replacement;
50};
51
52}}
53
54#endif
String class used across the library. Is a substitute for C# System.String when translating code....
Definition: string.h:122
Provides fallback API to handle decoding error. Objects of this class should only be allocated using ...
Definition: decoder_fallback.h:14
Provides fallback strategy of replacing erroneous symbol with a stub. Objects of this class should on...
Definition: decoder_replacement_fallback.h:19
DecoderReplacementFallback(const String &replacement_)
Constructor.
Definition: decoder_replacement_fallback.h:25
virtual DecoderFallbackBufferPtr CreateFallbackBuffer() override
Creates fallback buffer.
const String & get_DefaultString() const
Gets replacement string.
Definition: decoder_replacement_fallback.h:36
virtual int get_MaxCharCount() const override
Gets maximal count of characters the instance can return.
Definition: decoder_replacement_fallback.h:39
DecoderReplacementFallback()
Constructor that uses deafault "?" replacement string.
Definition: decoder_replacement_fallback.h:22
~DecoderReplacementFallback() override
Destructor.
@ Text
Defines color adjustment information for text.
Definition: db_command.h:9