/***********************************************************************/ /* The JSON tree node. Can be an Object or an Array. */ /***********************************************************************/ typedefstruct _jnode {
PSZ Key; // The key used for object
OPVAL Op; // Operator used for this node
PVAL CncVal; // To cont value used for OP_CNC
PVAL Valp; // The internal array VALUE int Rank; // The rank in array int Rx; // Read row number int Nx; // Next to read row number
} JNODE, *PJNODE;
/***********************************************************************/ /* Class used to get the columns of a mongo collection. */ /***********************************************************************/ class JSONDISC : public BLOCK { public: // Constructor
JSONDISC(PGLOBAL g, uint *lg);
// Methods bool DefineAM(PGLOBAL g, LPCSTR am, int poff) override;
PTDB GetTable(PGLOBAL g, MODE m) override;
protected: // Members
JMODE Jmode; /* MODE_OBJECT by default */
PCSZ Objname; /* Name of first level object */
PCSZ Xcol; /* Name of expandable column */ int Limit; /* Limit of multiple values */ int Pretty; /* Depends on file structure */ int Base; /* The array index base */ bool Strict; /* Strict syntax checking */ char Sep; /* The Jpath separator */ constchar *Uri; /* MongoDB connection URI */
PCSZ Collname; /* External collection name */
PSZ Options; /* Colist ; Pipe */
PSZ Filter; /* Filter */
PSZ Driver; /* MongoDB Driver (C or JAVA) */ bool Pipe; /* True if Colist is a pipeline */ int Version; /* Driver version */
PSZ Wrapname; /* MongoDB java wrapper name */
}; // end of JSONDEF
/* -------------------------- TDBJSN class --------------------------- */
/***********************************************************************/ /* This is the JSN Access Method class declaration. */ /* The table is a DOS file, each record being a JSON object. */ /***********************************************************************/ class DllExport TDBJSN : public TDBDOS { friendclass JSONCOL; friendclass JSONDEF; friendclass JSONDISC; #ifdefined(CMGO_SUPPORT) friendclass CMGFAM; #endif// CMGO_SUPPORT #ifdefined(JAVA_SUPPORT) friendclass JMGFAM; #endif// JAVA_SUPPORT public: // Constructor
TDBJSN(PJDEF tdp, PTXF txfp);
TDBJSN(TDBJSN *tdbp);
// Members
PGLOBAL G; // Support of parse memory
PJSON Top; // The top JSON tree
PJSON Row; // The current row
PJVAL Val; // The value of the current row
PJCOL Colp; // The multiple column
JMODE Jmode; // MODE_OBJECT by default
PCSZ Objname; // The table object name
PCSZ Xcol; // Name of expandable column int Fpos; // The current row index int N; // The current Rownum int M; // Index of multiple value int Limit; // Limit of multiple values int Pretty; // Depends on file structure int NextSame; // Same next row int SameRow; // Same row nb int Xval; // Index of expandable array int B; // Array index base char Sep; // The Jpath separator bool Strict; // Strict syntax checking bool Comma; // Row has final comma bool Xpdable; // False: expandable columns are NULL
}; // end of class TDBJSN
/* -------------------------- JSONCOL class -------------------------- */
/***********************************************************************/ /* Class JSONCOL: JSON access method column descriptor. */ /***********************************************************************/ class DllExport JSONCOL : public DOSCOL { friendclass TDBJSN; friendclass TDBJSON; #ifdefined(CMGO_SUPPORT) friendclass CMGFAM; #endif// CMGO_SUPPORT #ifdefined(JAVA_SUPPORT) friendclass JMGFAM; #endif// JAVA_SUPPORT public: // Constructors
JSONCOL(PGLOBAL g, PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i);
JSONCOL(JSONCOL *colp, PTDB tdbp); // Constructor used in copy process
protected: bool CheckExpand(PGLOBAL g, int i, PSZ nm, bool b); bool SetArrayOptions(PGLOBAL g, char *p, int i, PSZ nm);
PVAL GetColumnValue(PGLOBAL g, PJSON row, int i);
PVAL ExpandArray(PGLOBAL g, PJAR arp, int n);
PVAL CalculateArray(PGLOBAL g, PJAR arp, int n);
PVAL MakeJson(PGLOBAL g, PJSON jsp, int n);
PJVAL GetRowValue(PGLOBAL g, PJSON row, int i); void SetJsonValue(PGLOBAL g, PVAL vp, PJVAL val);
PJSON GetRow(PGLOBAL g);
// Default constructor not to be used
JSONCOL(void) = default;
// Members
PGLOBAL G; // Support of parse memory
TDBJSN *Tjp; // To the JSN table block
PVAL MulVal; // To value used by multiple column char *Jpath; // The json path
JNODE *Nodes; // The intermediate objects int Nod; // The number of intermediate objects int Xnod; // Index of multiple values char Sep; // The Jpath separator bool Xpd; // True for expandable column bool Parsed; // True when parsed bool Warned; // True when warning issued bool Sgfy; // True if stringified
}; // end of class JSONCOL
/* -------------------------- TDBJSON class -------------------------- */
/***********************************************************************/ /* This is the JSON Access Method class declaration. */ /***********************************************************************/ class DllExport TDBJSON : public TDBJSN { friendclass JSONDEF; friendclass JSONCOL; public: // Constructor
TDBJSON(PJDEF tdp, PTXF txfp);
TDBJSON(PJTDB tdbp);
// Members
PJAR Doc; // The document array int Multiple; // 0: No 1: DIR 2: Section 3: filelist bool Done; // True when document parsing is done bool Changed; // After Update, Insert or Delete
}; // end of class TDBJSON
/***********************************************************************/ /* This is the class declaration for the JSON catalog table. */ /***********************************************************************/ class DllExport TDBJCL : public TDBCAT { public: // Constructor
TDBJCL(PJDEF tdp);
protected: // Specific routines
PQRYRES GetResult(PGLOBAL g) override;
// Members
PTOS Topt;
PCSZ Db;
PCSZ Dsn;
}; // end of class TDBJCL
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet am 2026-10-08)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.