Bentley/ValueFormat.h
Go to the documentation of this file.
1 /*--------------------------------------------------------------------------------------+
2 |
3 | Supplied under applicable software license agreement.
4 |
5 | Copyright (c) 2018 Bentley Systems, Incorporated. All rights reserved.
6 |
7 +---------------------------------------------------------------------------------------*/
8 #pragma once
9 
10 #include "Bentley.h"
11 #include "WString.h"
12 #include "RefCounted.h"
13 #include "ValueFormat.r.h"
14 
16 
18 
21 
23 
24 //=======================================================================================
27 // @bsiclass Bentley Systems
28 //=======================================================================================
30 {
31 private:
33 
34 
36 public: BENTLEYDLL_EXPORT PrecisionFormat GetPrecision () const;
37 
39 public: BENTLEYDLL_EXPORT WChar GetDecimalSeparator () const;
40 
42 public: BENTLEYDLL_EXPORT bool GetInsertThousandsSeparator () const;
43 
45 public: BENTLEYDLL_EXPORT WChar GetThousandsSeparator () const;
46 
49 public: BENTLEYDLL_EXPORT bool GetLeadingZero () const;
50 
53 public: BENTLEYDLL_EXPORT bool GetTrailingZeros () const;
54 
56 public: BENTLEYDLL_EXPORT void SetPrecision (PrecisionFormat newVal);
57 
59 public: BENTLEYDLL_EXPORT void SetDecimalSeparator (WChar newVal);
60 
62 public: BENTLEYDLL_EXPORT void SetThousandsSeparator (WChar newVal);
63 
65 public: BENTLEYDLL_EXPORT void SetInsertThousandsSeparator (bool newVal );
66 
70 public: BENTLEYDLL_EXPORT void SetLeadingZero (bool newVal);
71 
75 public: BENTLEYDLL_EXPORT void SetTrailingZeros (bool newVal);
76 };
77 
78 //=======================================================================================
92 // @bsiclass Bentley Systems
93 //=======================================================================================
95 {
96 private:
97  virtual void MakeClassAbstract() = 0;
98 public:
99 
101 public: static BENTLEYDLL_EXPORT PrecisionType GetTypeFromPrecision (PrecisionFormat in);
102 
104 public: static BENTLEYDLL_EXPORT DoubleFormatterPtr Create ();
105 
107 public: BENTLEYDLL_EXPORT DoubleFormatterPtr Clone () const;
108 
111 public: BENTLEYDLL_EXPORT WString ToString (double value) const;
112 };
113 
115 
117 
#define BENTLEYDLL_EXPORT
Definition: Bentley.h:249
wchar_t WChar
Definition: Bentley.h:223
PrecisionFormat
Used by various formatters to specify the format of non-integer values.
Definition: ValueFormat.r.h:27
NEED_DOCUMENTATION.
Definition: Bentley/ValueFormat.h:29
RefCountedPtr< DoubleFormatter > DoubleFormatterPtr
Definition: Bentley/ValueFormat.h:22
Used to construct a string from a numerical value.
Definition: Bentley/ValueFormat.h:94
#define BEGIN_BENTLEY_NAMESPACE
Definition: Bentley.r.h:24
PrecisionType
Definition: ValueFormat.r.h:16
A shared pointer template for reference-counted objects.
Definition: RefCounted.h:119
Defines typedefs and constants that can be used across other namespaces. All Bentley-authored C++ sou...
#define BENTLEY_TYPEDEFS(_name_)
Definition: Bentley.h:152
Concrete class that can be used to implement the reference-counting pattern.
Definition: RefCounted.h:109
#define END_BENTLEY_NAMESPACE
Definition: Bentley.r.h:25
A string class that has many of the same capabilities as std::string, plus additional functions such ...
Definition: WString.h:51

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.