| 2263 |
kivins |
1 |
//---------------------------------------------------------------------------
|
|
|
2 |
|
|
|
3 |
#ifndef TXMLSchemaH
|
|
|
4 |
#define TXMLSchemaH
|
|
|
5 |
//---------------------------------------------------------------------------
|
|
|
6 |
#include <SysUtils.hpp>
|
|
|
7 |
#include <Controls.hpp>
|
|
|
8 |
#include <Classes.hpp>
|
|
|
9 |
#include <Forms.hpp>
|
|
|
10 |
#include <ComCtrls.hpp>
|
|
|
11 |
|
|
|
12 |
namespace XMLSchema {
|
|
|
13 |
class IXmlSchemaWrapperElement;
|
|
|
14 |
class IXmlSchemaWrapperFactory;
|
|
|
15 |
class IXmlSchemaWrapperQualification;
|
|
|
16 |
class IXmlSchemaWrapperSchema;
|
|
|
17 |
}
|
|
|
18 |
|
|
|
19 |
#include <string>
|
|
|
20 |
#include <vector>
|
|
|
21 |
|
|
|
22 |
#include "time.h"
|
|
|
23 |
#include "ISerialise.h"
|
|
|
24 |
#include "ISchemaElement.h"
|
|
|
25 |
#include "FieldDatatype.h"
|
|
|
26 |
#include "XmlSchemaWrapper.h"
|
|
|
27 |
|
|
|
28 |
//---------------------------------------------------------------------------
|
|
|
29 |
class PACKAGE TXMLSchema : public TComponent
|
|
|
30 |
{
|
|
|
31 |
private:
|
|
|
32 |
void __fastcall SetDLL_Location(AnsiString Value);
|
|
|
33 |
|
|
|
34 |
// Property Attributes
|
|
|
35 |
bool m_active;
|
|
|
36 |
AnsiString m_profile;
|
|
|
37 |
AnsiString m_moduleName;
|
|
|
38 |
AnsiString m_moduleVersion;
|
|
|
39 |
|
|
|
40 |
// XML Schema Wrapper attributes
|
|
|
41 |
AnsiString m_xmlSchemaWrapperLibrary;
|
|
|
42 |
HINSTANCE m_xmlSchemaWrapper;
|
|
|
43 |
getXmlSchemaWrapperFactory_t m_getXmlSchemaWrapperFactory;
|
|
|
44 |
XMLSchema::IXmlSchemaWrapperFactory * m_xmlSchemaWrapperFactory;
|
|
|
45 |
XMLSchema::IXmlSchemaWrapperSchema * m_xmlSchema;
|
|
|
46 |
|
|
|
47 |
private:
|
|
|
48 |
static AnsiString & __fastcall prependMassConfig( AnsiString & string, const AnsiString & filename );
|
|
|
49 |
void __fastcall TXMLSchema::readProfile();
|
|
|
50 |
|
|
|
51 |
protected:
|
|
|
52 |
|
|
|
53 |
public:
|
|
|
54 |
__fastcall TXMLSchema(TComponent* Owner);
|
|
|
55 |
void __fastcall SetActive(bool Value);
|
|
|
56 |
void __fastcall setProfile( const AnsiString & profile );
|
|
|
57 |
|
|
|
58 |
bool __fastcall GetSchemas(std::vector<std::string> &schemas);
|
|
|
59 |
bool __fastcall GetAttributes(const std::string& handle, std::vector<std::string> &attributes, bool specificationOnly = false);
|
|
|
60 |
bool __fastcall GetAttributeProperty(const std::string &handle, const std::string &property_name, std::string &value);
|
|
|
61 |
bool __fastcall Create (const char *structure_name, unsigned short version, std::string &handle, const char *qualifier);
|
|
|
62 |
bool __fastcall Create (const char *schema, const char *structure_name, unsigned short version, std::string &handle, const char *qualifier);
|
|
|
63 |
bool __fastcall Destroy(std::string& handle);
|
|
|
64 |
bool __fastcall Copy (const std::string &src_handle, const std::string &dest_handle, const XMLSchema::XMLSchemaCopyArgs ©args);
|
|
|
65 |
bool __fastcall Validate (const std::string &src_handle);
|
|
|
66 |
|
|
|
67 |
bool __fastcall Deserialise(const std::string& handle, const std::string& streamtype, const std::string& stream_args, int &required_alignment, const char *buffer, unsigned int bufsize, XMLSchema::StreamCallback callbackfn = 0);
|
|
|
68 |
bool __fastcall Serialise (const std::string &handle, const std::string& streamtype, const std::string& stream_args, void *&stream, unsigned int& stream_size, XMLSchema::IXmlSchemaWrapperQualification * qualifier, const char *serialise_qualifier, unsigned char required_alignment);
|
|
|
69 |
|
|
|
70 |
bool __fastcall SetUDTArgs(const char *udtName, int argc, const char** argv);
|
|
|
71 |
|
|
|
72 |
bool __fastcall GetAttributeValue(const std::string &handle, const std::string& attribute_path, std::string &value);
|
|
|
73 |
bool __fastcall GetAttributeValue(const std::string &handle, const std::string& attribute_path, AnsiString &value);
|
|
|
74 |
bool __fastcall GetAttributeValue(const std::string &handle, const std::string& attribute_path, int &value);
|
|
|
75 |
|
|
|
76 |
bool __fastcall SetAttributeValue (const std::string &handle, const std::string& attribute_path, const char *value);
|
|
|
77 |
bool __fastcall SetAttributeValue (const std::string &handle, const std::string& attribute_path, const AnsiString &value);
|
|
|
78 |
bool __fastcall SetAttributeValue (const std::string &handle, const std::string& attribute_path, const int &value);
|
|
|
79 |
bool __fastcall SetAttributeValue (const std::string &handle, const std::string& attribute_path, void *value, unsigned int len);
|
|
|
80 |
|
|
|
81 |
bool __fastcall GetEnumerationValues (const std::string &handle, const char *enumeration, std::vector<std::string> &values);
|
|
|
82 |
bool __fastcall GetEnumerationIdValue (const std::string &handle, const char *enumeration, const char *id, std::string &value);
|
|
|
83 |
bool __fastcall AddRepeatEntry (const std::string &handle, const unsigned int entry);
|
|
|
84 |
bool __fastcall RemoveRepeatEntry (const std::string &handle, const unsigned int entry);
|
|
|
85 |
bool __fastcall Sort(const std::string &handle, const std::string &repeat_name, std::vector<std::string> &sort_fields );
|
|
|
86 |
bool __fastcall Refresh();
|
|
|
87 |
void __fastcall GetVersionInfo(AnsiString &module_name, AnsiString &module_version);
|
|
|
88 |
|
|
|
89 |
XMLSchema::IXmlSchemaWrapperFactory * GetSchemaWrapperFactory( void );
|
|
|
90 |
XMLSchema::IXmlSchemaWrapperSchema * GetSchema( void );
|
|
|
91 |
XMLSchema::IXmlSchemaWrapperElement * CreateSchemaElementAccess( const std::string & handle, const std::string & attribute_path ) const;
|
|
|
92 |
void DestroySchemaElementAccess( const XMLSchema::IXmlSchemaWrapperElement& instance ) const;
|
|
|
93 |
|
|
|
94 |
__published:
|
|
|
95 |
__property bool Active = {read=m_active, write=SetActive, default=0};
|
|
|
96 |
__property AnsiString Profile = {read=m_profile, default=0};
|
|
|
97 |
__property AnsiString ModuleName = {read=m_moduleName, default=0};
|
|
|
98 |
__property AnsiString ModuleVersion = {read=m_moduleVersion, default=0};
|
|
|
99 |
};
|
|
|
100 |
|
|
|
101 |
//---------------------------------------------------------------------------
|
|
|
102 |
#endif
|