GetOverrideFileIO

This function get the current overrides for type of file saved / exported independent of the extension given. By default the extension of the file name will define the type saved / exported:
    .rdf => generated RDF serialized content
    .ttl => generated TTL serialized content
    .bin => generated BIN/X serialized content

Available formats
    RDF
    TTL
    BIN/L - readable but large BIN format
    BIN/S - Optimized Binary, only running within given revision
    BIN/X - Optimized Binary, running in all revisions supporting BIN/X

Force file type (overrides extension), works only on save (open selects correct type automatically)
  bit0 bit1 bit2
    0     0     0    [default] unset forced file type
    0     0     1    RESERVED
    0     1     0    TTL
    0     1     1    RDF
    1     0     0    BIN/X
    1     0     1    BIN/S
    1     1     0    RESERVED
    1     1     1    BIN/L

Force exporting as Base64
  bit4
    0    do not use Base64
    1    use Base64 (only works for BIN/S and BIN/X), on other formats no effect

Syntax

//
//   Strong typing definition
//
uint64_t        GetOverrideFileIO(
                        OwlModel                model,
                        uint64_t                mask
                    );


//
//   Weak typing definition
//
uint64_t    __declspec(dllexport) __stdcall GetOverrideFileIO(
                                                    int64_t                 model,
                                                    uint64_t                mask
                                                );
    

Property model

Size: 64 bit / 8 byte (value)
The handle to the model. The model handle is static during its existance. Several models can be opened simultaniously within one session. Different models are always independent, threads are allowed to be running on different models simultaniously.

Property mask

Size: 64 bit / 8 byte (value)
This mask or bitmask is data that is used for bitwise operations, i.e. the bits set in the mask are the bits affected in the setting or return value.

Example (based on pure API calls)

Here you can find code snippits that show how the API call GetOverrideFileIO can be used.

#include    "./include/engine.h"
#include    <assert.h>

static  const   uint64_t    flagbit0 = 1;   // 2^^0
static  const   uint64_t    flagbit1 = 2;   // 2^^1
static  const   uint64_t    flagbit2 = 4;   // 2^^2

enum serializations
{
    undefined = 0,
    RDF,
    TTL,
    BIN_X,
    BIN_L,
    BIN_S
};

void    SetSerialization(int64_t model, serializations serialization, bool unset)
{
    int64_t mask = flagbit0 + flagbit1 + flagbit2;

    if (unset) {
        SetOverrideFileIO(model, 0, mask);
    }
    else {
        int64_t setting = 0;

        switch (serialization) {
            case  TTL:
                setting = flagbit1;
                break;
            case  RDF:
                setting = flagbit1 + flagbit2;
                break;
            case  BIN_X:
                setting = flagbit0;
                break;
            case  BIN_S:
                setting = flagbit0 + flagbit2;
                break;
            case  BIN_L:
                setting = flagbit0 + flagbit1 + flagbit2;
                break;
        }

        SetOverrideFileIO(model, setting, mask);
    }
}

serializations  GetSerialization(int64_t model, bool * unset)
{
    int64_t mask = flagbit0 + flagbit1 + flagbit2;

    switch (GetOverrideFileIO(model, mask)) {
        case  0:
            (*unset) = true;
        case  flagbit1:
            return  TTL;
        case  flagbit1 + flagbit2:
            return  RDF;
        case  flagbit0:
            return  BIN_X;
        case  flagbit0 + flagbit2:
            return  BIN_S;
        case  flagbit0 + flagbit1 + flagbit2:
            return  BIN_L;
        default:
            assert(false);
            break;
    }

    return  undefined;
}

void    main()
{
    int64_t model = OpenModel("c:\\created\\myBox.bin");

    if (model) {
        //  Save in RDF serialization
        SaveModel(model, "c:\\created\\myFile001.rdf");

        //  Save in BIN_X serialization
        SaveModel(model, "c:\\created\\myFile002.bin");

        SetSerialization(model, BIN_L, false);

        //  Save in BIN_L serialization
        SaveModel(model, "c:\\created\\myFile003.xyz");

        bool    unset = false;
        assert(GetSerialization(model, &unset) == BIN_L && unset == false);

        CloseModel(model);
    }
}