A utility class that helps with formatting lengths, or distances.
More...
#include <ilengthformatter.h>
List of all members.
Public Member Functions |
virtual AtLastUstring | Format (double length, int precision=14) const =0 |
| Formats the given value into a String representation based on the Document's current units settings.
|
virtual bool | Parse (LPCWSTR strValue, double *pVal) const =0 |
| Parses the given string representation of a length, putting the result in the given double value.
|
Detailed Description
A utility class that helps with formatting lengths, or distances.
Member Function Documentation
virtual AtLastUstring atlast::sketchup::ISketchUpLengthFormatter::Format |
( |
double |
length, |
|
|
int |
precision = 14 | |
|
) |
| | const [pure virtual] |
Formats the given value into a String representation based on the Document's current units settings.
- Parameters:
-
| length | The value to format. TODO: Can it be negative? |
| precision | An optional argument that dictates the precision to be used in the formatting. The value must be > 0 and <= 14. |
- Returns:
- The formatted length value.
virtual bool atlast::sketchup::ISketchUpLengthFormatter::Parse |
( |
LPCWSTR |
strValue, |
|
|
double * |
pVal | |
|
) |
| | const [pure virtual] |
Parses the given string representation of a length, putting the result in the given double value.
This method will attempt to parse the given string which should represent a length. The result goes in the given double value if not NULL.
- Parameters:
-
| strValue | The string representation to be parsed. |
| pVal | The optional parameter that will be populated with the parsed value if not NULL and if the strValue parameter is valid. |
- Returns:
- true iff the value could be parsed as a length.