Commit 332c6176 authored by Olivier Bertrand's avatar Olivier Bertrand

Export TDBJSN class so it can be used by EOM tables

  modified:   storage/connect/filamtxt.cpp
  modified:   storage/connect/tabdos.cpp
  modified:   storage/connect/tabjson.cpp
  modified:   storage/connect/tabjson.h
parent 8bd1f06c
...@@ -71,8 +71,23 @@ TXTFAM::TXTFAM(PDOSDEF tdp) ...@@ -71,8 +71,23 @@ TXTFAM::TXTFAM(PDOSDEF tdp)
{ {
Tdbp = NULL; Tdbp = NULL;
To_Fb = NULL; To_Fb = NULL;
To_File = tdp->Fn;
Lrecl = tdp->Lrecl; if (tdp) {
To_File = tdp->Fn;
Lrecl = tdp->Lrecl;
Eof = tdp->Eof;
Ending = tdp->Ending;
} else {
To_File = NULL;
Lrecl = 0;
Eof = false;
#if defined(__WIN__)
Ending = 2;
#else
Ending = 1;
#endif
} // endif tdp
Placed = false; Placed = false;
IsRead = true; IsRead = true;
Blocked = false; Blocked = false;
...@@ -103,8 +118,6 @@ TXTFAM::TXTFAM(PDOSDEF tdp) ...@@ -103,8 +118,6 @@ TXTFAM::TXTFAM(PDOSDEF tdp)
Blksize = 0; Blksize = 0;
Fpos = Spos = Tpos = 0; Fpos = Spos = Tpos = 0;
Padded = false; Padded = false;
Eof = tdp->Eof;
Ending = tdp->Ending;
Abort = false; Abort = false;
CrLf = (char*)(Ending == 1 ? "\n" : "\r\n"); CrLf = (char*)(Ending == 1 ? "\n" : "\r\n");
} // end of TXTFAM standard constructor } // end of TXTFAM standard constructor
......
...@@ -2358,7 +2358,7 @@ DOSCOL::DOSCOL(PGLOBAL g, PCOLDEF cdp, PTDB tp, PCOL cp, int i, PSZ am) ...@@ -2358,7 +2358,7 @@ DOSCOL::DOSCOL(PGLOBAL g, PCOLDEF cdp, PTDB tp, PCOL cp, int i, PSZ am)
Dval = NULL; Dval = NULL;
Buf = NULL; Buf = NULL;
if (txfp->Blocked && Opt && (cdp->GetMin() || cdp->GetDval())) { if (txfp && txfp->Blocked && Opt && (cdp->GetMin() || cdp->GetDval())) {
int nblk = txfp->GetBlock(); int nblk = txfp->GetBlock();
Clustered = (cdp->GetXdb2()) ? 2 : 1; Clustered = (cdp->GetXdb2()) ? 2 : 1;
......
...@@ -441,7 +441,7 @@ PTDB JSONDEF::GetTable(PGLOBAL g, MODE m) ...@@ -441,7 +441,7 @@ PTDB JSONDEF::GetTable(PGLOBAL g, MODE m)
if (Zipped) { if (Zipped) {
#if defined(ZIP_SUPPORT) #if defined(ZIP_SUPPORT)
if (m == MODE_READ || m == MODE_UPDATE) { if (m == MODE_READ || m == MODE_READX) {
txfp = new(g) UNZFAM(this); txfp = new(g) UNZFAM(this);
} else if (m == MODE_INSERT) { } else if (m == MODE_INSERT) {
txfp = new(g) ZIPFAM(this); txfp = new(g) ZIPFAM(this);
...@@ -486,7 +486,7 @@ PTDB JSONDEF::GetTable(PGLOBAL g, MODE m) ...@@ -486,7 +486,7 @@ PTDB JSONDEF::GetTable(PGLOBAL g, MODE m)
} else { } else {
if (Zipped) { if (Zipped) {
#if defined(ZIP_SUPPORT) #if defined(ZIP_SUPPORT)
if (m == MODE_READ || m == MODE_UPDATE) { if (m == MODE_READ || m == MODE_READX) {
txfp = new(g) UNZFAM(this); txfp = new(g) UNZFAM(this);
} else if (m == MODE_INSERT) { } else if (m == MODE_INSERT) {
strcpy(g->Message, "INSERT supported only for zipped JSON when pretty=0"); strcpy(g->Message, "INSERT supported only for zipped JSON when pretty=0");
......
/*************** tabjson H Declares Source Code File (.H) **************/ /*************** tabjson H Declares Source Code File (.H) **************/
/* Name: tabjson.h Version 1.1 */ /* Name: tabjson.h Version 1.2 */
/* */ /* */
/* (C) Copyright to the author Olivier BERTRAND 2014 - 2015 */ /* (C) Copyright to the author Olivier BERTRAND 2014 - 2017 */
/* */ /* */
/* This file contains the JSON classes declares. */ /* This file contains the JSON classes declares. */
/***********************************************************************/ /***********************************************************************/
...@@ -32,7 +32,7 @@ typedef struct _jnode { ...@@ -32,7 +32,7 @@ typedef struct _jnode {
/***********************************************************************/ /***********************************************************************/
/* JSON table. */ /* JSON table. */
/***********************************************************************/ /***********************************************************************/
class JSONDEF : public DOSDEF { /* Table description */ class DllExport JSONDEF : public DOSDEF { /* Table description */
friend class TDBJSON; friend class TDBJSON;
friend class TDBJSN; friend class TDBJSN;
friend class TDBJCL; friend class TDBJCL;
...@@ -66,7 +66,7 @@ class JSONDEF : public DOSDEF { /* Table description */ ...@@ -66,7 +66,7 @@ class JSONDEF : public DOSDEF { /* Table description */
/* This is the JSN Access Method class declaration. */ /* This is the JSN Access Method class declaration. */
/* The table is a DOS file, each record being a JSON object. */ /* The table is a DOS file, each record being a JSON object. */
/***********************************************************************/ /***********************************************************************/
class TDBJSN : public TDBDOS { class DllExport TDBJSN : public TDBDOS {
friend class JSONCOL; friend class JSONCOL;
friend class JSONDEF; friend class JSONDEF;
public: public:
...@@ -127,7 +127,7 @@ class TDBJSN : public TDBDOS { ...@@ -127,7 +127,7 @@ class TDBJSN : public TDBDOS {
/***********************************************************************/ /***********************************************************************/
/* Class JSONCOL: JSON access method column descriptor. */ /* Class JSONCOL: JSON access method column descriptor. */
/***********************************************************************/ /***********************************************************************/
class JSONCOL : public DOSCOL { class DllExport JSONCOL : public DOSCOL {
friend class TDBJSN; friend class TDBJSN;
friend class TDBJSON; friend class TDBJSON;
public: public:
...@@ -174,7 +174,7 @@ class JSONCOL : public DOSCOL { ...@@ -174,7 +174,7 @@ class JSONCOL : public DOSCOL {
/***********************************************************************/ /***********************************************************************/
/* This is the JSON Access Method class declaration. */ /* This is the JSON Access Method class declaration. */
/***********************************************************************/ /***********************************************************************/
class TDBJSON : public TDBJSN { class DllExport TDBJSON : public TDBJSN {
friend class JSONDEF; friend class JSONDEF;
friend class JSONCOL; friend class JSONCOL;
public: public:
...@@ -221,7 +221,7 @@ class TDBJSON : public TDBJSN { ...@@ -221,7 +221,7 @@ class TDBJSON : public TDBJSN {
/***********************************************************************/ /***********************************************************************/
/* This is the class declaration for the JSON catalog table. */ /* This is the class declaration for the JSON catalog table. */
/***********************************************************************/ /***********************************************************************/
class TDBJCL : public TDBCAT { class DllExport TDBJCL : public TDBCAT {
public: public:
// Constructor // Constructor
TDBJCL(PJDEF tdp); TDBJCL(PJDEF tdp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment