33#include <NDEVR/Vector.h>
34#include <NDEVR/Bounds.h>
35#include <NDEVR/NumberParser.h>
36#include <NDEVR/ObjectInfo.h>
37#include <NDEVR/Buffer.h>
41#pragma warning( disable : 4661)
47 class TranslatedString;
228 template<
class t_type>
261 static void toString(
const String& value,
String&
string);
263 static void fromString(
const String&
string,
String& value);
264 static const char* getValidRegex();
266 template<u
int01 t_dims,
class t_type>
267 class StringStream<Vector<t_dims, t_type>>
270 static void toString(
const Vector<t_dims, t_type>& value, String&
string)
273 for (
uint01 dim = 1; dim < t_dims; ++dim)
280 static void fromString(
const String&
string, Vector<t_dims, t_type>& value)
282 if constexpr (ObjectInfo<t_type>::Number)
286 for (
uint01 dim = 0; dim < t_dims; ++dim)
289 for (; iter < end; iter++)
297 for (; dim < t_dims; ++dim)
309 for (
uint01 dim = 0; dim < t_dims; ++dim)
311 if (parts.size() > dim)
313 t_type val = value[dim];
322 static void toDisplayString(
const Vector<t_dims, t_type>& value, TranslatedString&
string) {
return toString(value,
string); }
330 template<u
int01 t_dims,
class t_type>
331 class StringStream<Bounds<t_dims, t_type>>
334 static void toString(
const Bounds<t_dims, t_type>& value, String&
string)
336 StringStream<Vector<t_dims, t_type>>
::toString(value[
MIN],
string);
338 StringStream<Vector<t_dims, t_type>>
::toString(value[
MAX],
string);
341 static void fromString(
const String&
string, Bounds<t_dims, t_type>& value)
344 if (parts.size() < 2)
346 value = Constant<Bounds<t_dims, t_type>>
::Invalid;
350 StringStream<Vector<t_dims, t_type>>
::fromString(parts[0], value[
MIN]);
351 StringStream<Vector<t_dims, t_type>>
::fromString(parts[1], value[
MAX]);
355 static void toDisplayString(
const Bounds<t_dims, t_type>& value, String&
string) {
return toString(value,
string); }
362 template<u
int01 t_dims,
class t_type,
class t_vector_type>
363 class StringStream<Vertex<t_dims, t_type, t_vector_type>>
366 static void toString(
const Vertex<t_dims, t_type, t_vector_type>& value, String&
string)
371 static void fromString(
const String&
string, Vertex<t_dims, t_type, t_vector_type>& value)
375 static void toDisplayString(
const Vertex<t_dims, t_type, t_vector_type>& value, TranslatedString&
string) {
return toString(value,
string); }
381 template<u
int01 t_dims,
class t_type,
class t_vector_type>
382 class StringStream<Ray<t_dims, t_type, t_vector_type>>
385 static void toString(
const Ray<t_dims, t_type, t_vector_type>& value, String&
string)
390 static void fromString(
const String&
string, Ray<t_dims, t_type, t_vector_type>& value)
394 static void toDisplayString(
const Ray<t_dims, t_type, t_vector_type>& value, TranslatedString&
string) {
return toString(value,
string); }
400 template<
class t_type,
class t_index_type,
class t_memory_allocater,
class t_memory_manager>
401 class StringStream<Buffer<t_type, t_index_type, t_memory_allocater, t_memory_manager>>
404 static void toString(
const Buffer<t_type, t_index_type, t_memory_allocater, t_memory_manager>& value, String&
string)
406 for (
uint04 i = 0; i < value.size(); i++)
412 static void fromString(
const String&
string, Buffer<t_type, t_index_type, t_memory_allocater, t_memory_manager>& value)
415 value.setSize(strings.size());
416 for (
uint04 i = 0; i < value.size(); i++)
421 static void toDisplayString(
const Buffer<t_type, t_index_type, t_memory_allocater, t_memory_manager>& value, TranslatedString&
string) {
return toString(value,
string); }
446 template<
class t_type, u
int01 t_row_dims, u
int01 t_col_dims>
447 class StringStream<Matrix<t_type, t_row_dims, t_col_dims>>
450 static void toString(
const Matrix<t_type, t_row_dims, t_col_dims>& value, String&
string)
452 for (
uint01 col = 0; col < t_col_dims; ++col)
455 for (
uint01 row = 1; row < t_row_dims; ++row)
464 static void fromString(
const String&
string, Matrix<t_type, t_row_dims, t_col_dims>& value)
467 for (
uint01 col = 0; col < t_col_dims; ++col)
469 if (col < columns.size())
472 for (
uint01 row = 0; row < t_row_dims; ++row)
474 if (row < rows.size())
482 for (
uint01 row = 0; row < t_row_dims; ++row)
489 static void toDisplayString(
const Matrix<t_type, t_row_dims, t_col_dims>& value, TranslatedString&
string) {
return toString(value,
string); }
539 template<
class t_type>
The primary angle storage class for this API. Stores an angle in an optimized format.
Definition StringStream.h:540
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
Logic for reading or writing to a file as well as navigating filesystems.
Definition File.h:48
static t_type parse(const char *in, const char **out=nullptr, t_type Invalid_Value=Constant< t_type >::Invalid, bool check_overflow=true)
Definition NumberParser.hpp:86
The core String class for the NDEVR API.
Definition String.h:69
Logic for splitting a string into two.
Definition StringStream.h:52
static const char * begin(const String &s)
static Buffer< String, uint04, ObjectAllocator< false > > split(const String &s, char split)
static const char * end(const String &s)
Logic for reading or writing to a string or a user friendly, TranslatedString.
Definition StringStream.h:230
static void toString(const t_type &value, String &string)
Logic for converting an object to an NDEVR API String allowing it to be used automatically with the S...
static void fromString(const String &string, t_type &value)
Logic for converting an object from an NDEVR API String allowing it to be used automatically with get...
static const char * getValidRegex()
Optionally specified to allow the software to do a check on user or file input to ensure that fromStr...
static void toDisplayString(const t_type &value, TranslatedString &string)
Logic for converting an object to an NDEVR API translated, user facing string. This allows the object...
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
Definition TranslatedString.h:13
Stores information about a type, relevant for certain templated functions. To get information about a...
Definition TypeInfo.h:43
Logic for creating a regex for a given type of data.
Definition StringStream.h:62
static const char * ValidRegex(const TypeInfo &info)
@ MIN
Definition BaseValues.hpp:196
@ MAX
Definition BaseValues.hpp:197
InterpolationValues
Values that represent interpolation functions. Useful in large or complicated geological or time base...
Definition BaseValues.hpp:221
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:80
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96
static const t_type Invalid
Definition BaseValues.hpp:234