High Performance OPC UA Server SDK  1.2.0.193
ua_file_writer Struct Reference

UA File Writer. More...

#include <file_writer.h>

Public Member Functions

int ua_file_writer_open (struct ua_file_writer *w, const char *filename)
 Creates a new file for writing and writes the file header, the global extension table, string tables and namespaces tables. More...
 
int ua_file_writer_add_stringtables (struct ua_file_writer *w, unsigned int num_strings, const char *locales)
 Creates a strings table for each locale. More...
 

Data Fields

char * filename
 
ua_file_t f
 
uint32_t num_reqnamespaces
 
uint32_t num_namespaces
 
struct ua_file_node_stat stat
 
uint32_t num_stringtables
 
struct ua_file_stringtablestringtables
 
struct ua_file_namespacereqnamespacetable
 
struct ua_file_namespacenamespacetable
 
struct ua_file_extensions extensions
 

Detailed Description

UA File Writer.

This object is used to serialize UA information models into the Unified Automation UA Binary File Format. This is used on PCs for xml2bin and is not intended for embedded systems.

Member Function Documentation

int ua_file_writer_add_stringtables ( struct ua_file_writer w,
unsigned int  num_strings,
const char *  locales 
)

Creates a strings table for each locale.

The locales are separated by ";", the default locale can be an empty string "". Examples:

Only the default locale: ""
Two locales: ";de-DE", or "en-US;de-DE"
Parameters
wpointer to file writer
num_stringsnumbers of strings per table (table size).
localesString with locales. This indicates the number of string tables.
Returns
Zero on success.
int ua_file_writer_open ( struct ua_file_writer w,
const char *  filename 
)

Creates a new file for writing and writes the file header, the global extension table, string tables and namespaces tables.

Thus you must add this information before invoking this method. Then you can add all nodes and references and finally close the file writer.

Correct order of calls:

  1. ua_file_writer_init
  2. ua_file_writer_add_stringtables
  3. ua_file_writer_add_string
  4. ua_file_writer_add_namespace
  5. ua_file_writer_add_extension
  6. ua_file_writer_open
  7. ua_file_writer_add_datatype
  8. ua_file_writer_add_referencetype
  9. ua_file_writer_add_variabletype
  10. ua_file_writer_add_objecttype
  11. ua_file_writer_add_variable
  12. ua_file_writer_add_object
  13. ua_file_writer_add_method
  14. ua_file_writer_add_view
  15. ua_file_writer_close
  16. ua_file_writer_clear
Parameters
wFile writer instance.
filenameFilename to create.
Returns
Zero on success.

The documentation for this struct was generated from the following files: