7#include "ImportExport.h"
94 this->SetString(
string);
102 this->type = Type::Int32;
103 this->int32Value = v;
111 this->type = Type::Double;
112 this->doubleValue = v;
120 this->type = Type::Float;
121 this->floatValue = v;
129 this->type = Type::Boolean;
138 this->type = Type::String;
139 this->stringValue = v;
145 this->ThrowIfTypeIsUnequalTo(Type::Int32);
146 return this->int32Value;
152 this->ThrowIfTypeIsUnequalTo(Type::Double);
153 return this->doubleValue;
159 this->ThrowIfTypeIsUnequalTo(Type::Float);
160 return this->floatValue;
166 this->ThrowIfTypeIsUnequalTo(Type::Boolean);
167 return this->boolValue;
173 this->ThrowIfTypeIsUnequalTo(Type::String);
174 return this->stringValue;
188 std::int32_t int32Value;
194 std::string stringValue;
196 void ThrowIfTypeIsUnequalTo(Type typeToCheck)
const
198 if (this->type != typeToCheck)
200 throw std::runtime_error(
"Unexpected type encountered.");
212 kCurlHttp_Proxy = 100,
214 kCurlHttp_UserAgent = 101,
216 kCurlHttp_Timeout = 102,
218 kCurlHttp_ConnectTimeout = 103,
220 kCurlHttp_Xoauth2Bearer = 104,
222 kCurlHttp_Cookie = 105,
224 kCurlHttp_SslVerifyPeer = 106,
226 kCurlHttp_SslVerifyHost = 107,
228 kCurlHttp_FollowLocation = 108,
230 kCurlHttp_MaxRedirs = 109,
232 kCurlHttp_CaInfo = 110,
234 kCurlHttp_CaInfoBlob = 111,
239 kAzureBlob_AuthenticationMode = 200,
Here the keys for the property-bag with options for creating a stream-object are gathered.
Definition libCZI_StreamsLib.h:207
Definition libCZI_StreamsLib.h:27
static const char * kStreamClassInfoProperty_CurlHttp_CaInfo
Definition libCZI_StreamsLib.h:344
static std::shared_ptr< libCZI::IStream > CreateStream(const CreateStreamInfo &stream_info, const std::string &file_identifier)
static int GetStreamClassesCount()
static std::shared_ptr< libCZI::IStream > CreateDefaultStreamForFile(const wchar_t *filename)
static std::shared_ptr< libCZI::IStream > CreateStream(const CreateStreamInfo &stream_info, const std::wstring &file_identifier)
static bool GetStreamInfoForClass(int index, StreamClassInfo &stream_info)
static const StreamPropertyBagPropertyInfo * GetStreamPropertyBagPropertyInfo(int *count)
static std::shared_ptr< libCZI::IStream > CreateDefaultStreamForFile(const char *filename)
static const char * kStreamClassInfoProperty_CurlHttp_CaPath
Definition libCZI_StreamsLib.h:349
External interfaces, classes, functions and structs are found in the namespace "libCZI".
Definition libCZI.h:31
@ Invalid
Invalid frame of reference.
The parameters for creating an instance of a stream object.
Definition libCZI_StreamsLib.h:245
std::map< int, Property > property_bag
A property-bag with options for creating the stream-object.
Definition libCZI_StreamsLib.h:248
std::string class_name
Name of the class (this uniquely identifies the class).
Definition libCZI_StreamsLib.h:246
This declares a variant type (to be used with the property bag in the streams factory).
Definition libCZI_StreamsLib.h:31
Property(const std::string &v)
Definition libCZI_StreamsLib.h:84
void SetString(const std::string &v)
Definition libCZI_StreamsLib.h:136
float GetAsFloatOrThrow() const
Returns float value if ValueType is 'Float', otherwise throws a RuntimeError.
Definition libCZI_StreamsLib.h:157
Property(std::int32_t v)
Definition libCZI_StreamsLib.h:52
Type
Values that represent the type represented by this variant.
Definition libCZI_StreamsLib.h:35
Property(float v)
Definition libCZI_StreamsLib.h:68
Property(double v)
Definition libCZI_StreamsLib.h:60
void SetDouble(double v)
Definition libCZI_StreamsLib.h:109
std::string GetAsStringOrThrow() const
Returns string value if ValueType is string, otherwise throws a RuntimeError.
Definition libCZI_StreamsLib.h:171
double GetAsDoubleOrThrow() const
Returns double value if ValueType is double, otherwise throws a RuntimeError.
Definition libCZI_StreamsLib.h:150
void SetInt32(std::int32_t v)
Definition libCZI_StreamsLib.h:100
Property()
Default constructor - setting the variant to 'invalid'.
Definition libCZI_StreamsLib.h:45
Property(const char *string)
Definition libCZI_StreamsLib.h:92
bool GetAsBoolOrThrow() const
Returns boolean value if ValueType is boolean, otherwise throws a RuntimeError.
Definition libCZI_StreamsLib.h:164
Property(bool v)
Definition libCZI_StreamsLib.h:76
void SetBool(bool v)
Definition libCZI_StreamsLib.h:127
std::int32_t GetAsInt32OrThrow() const
Returns integer value if ValueType is int, otherwise throws a RuntimeError.
Definition libCZI_StreamsLib.h:143
Type GetType() const
Returns ValueType.
Definition libCZI_StreamsLib.h:178
void SetFloat(float v)
Definition libCZI_StreamsLib.h:118
This structure gathers information about a stream class.
Definition libCZI_StreamsLib.h:297
std::string class_name
Name of the class (this uniquely identifies the class).
Definition libCZI_StreamsLib.h:298
std::function< Property(const char *property_name)> get_property
Definition libCZI_StreamsLib.h:310
std::function< std::string()> get_build_info
Definition libCZI_StreamsLib.h:303
std::string short_description
A short and informal description of the class.
Definition libCZI_StreamsLib.h:299
Information about a property for the property bag when creating a stream object.
Definition libCZI_StreamsLib.h:253
int property_id
The numerical identifier for the property.
Definition libCZI_StreamsLib.h:255
Property::Type property_type
Type of the property.
Definition libCZI_StreamsLib.h:256
const char * property_name
(Proposed) name of the property. This is a null-terminated static string. It is enum name with the in...
Definition libCZI_StreamsLib.h:254