[Ocipl-commits] SF.net SVN: ocipl: [44] trunk
Brought to you by:
martinfuchs
|
From: <mar...@us...> - 2008-02-09 15:01:07
|
Revision: 44
http://ocipl.svn.sourceforge.net/ocipl/?rev=44&view=rev
Author: martinfuchs
Date: 2008-02-09 07:00:55 -0800 (Sat, 09 Feb 2008)
Log Message:
-----------
xmldump-Projekt hinzugef?\195?\188gt
Added Paths:
-----------
trunk/xmldump/
trunk/xmldump/xmldump.cpp
trunk/xmldump/xmldump.dsp
trunk/xmldump/xmldump.dsw
trunk/xmldump/xmldump.h
Property changes on: trunk/xmldump
___________________________________________________________________
Name: svn:ignore
+ Debug
Release
*.ncb
*.opt
*.res
*.exe
Added: trunk/xmldump/xmldump.cpp
===================================================================
--- trunk/xmldump/xmldump.cpp (rev 0)
+++ trunk/xmldump/xmldump.cpp 2008-02-09 15:00:55 UTC (rev 44)
@@ -0,0 +1,647 @@
+
+ //
+ // xmldump.cpp
+ //
+ // Copyright (c) 2005, 2007 Martin Fuchs <mar...@gm...>
+ //
+
+/*
+
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+
+*/
+
+#include <xmlstorage.h>
+using namespace XMLStorage;
+
+#include <iostream>
+using namespace std;
+
+#include <ocipl.h>
+using namespace OCIPL;
+
+#include <set>
+#include <iostream>
+using namespace std;
+
+#include <time.h>
+
+#include "xmldump.h"
+
+
+int main(int argc, char** argv)
+{
+ if (argc < 2) {
+ cerr << "xmldump <connect-string> [schema]\n";
+ return 1;
+ }
+
+ XMLDump dump;
+ LoginPara lp;
+
+ const char* conn_str = *++argv;
+ lp.parse(conn_str);
+
+ const char* schema = argc>=3? *++argv: lp._username.c_str();
+
+//TODO Kontrolle der Oracle-Version: >= 8.1.6
+
+ dump._data = false; //@@
+ dump._col_pos = false; //@@
+ dump._seq_val = false; //@@
+
+ //dump._filter.insert("EMP");
+ //dump._filter.insert("PLAN_TABLE");
+
+ try {
+
+ OciEnvAlloc env_alloc;
+ OciEnv env(env_alloc);
+
+ // dump database schema in XML format
+ XMLWriter writer(cout); //, PRETTY_LINEFEED);
+ dump.dump_schema(env, lp, schema, writer);
+
+ } catch(exception& e) {
+ cerr << "====\n"
+ "Exception: " << e.what() << "\n"
+ "====\n";
+ }
+
+ return 0;
+}
+
+
+static ColumnType* s_pcolTypes;
+
+static int cmp_col(const void* a, const void* b)
+{
+ int ia = *(int*)a;
+ int ib = *(int*)b;
+
+ return s_pcolTypes[ia]._name.compare(s_pcolTypes[ib]._name);
+}
+
+
+typedef pair<tstring, tstring> ObjIdent;
+
+ /// object info structure used in XMLDump::dump_schema()
+struct ObjInfo {
+ ub1 _type;
+
+ ObjInfo()
+ {
+ _type = -1;
+ }
+};
+
+typedef map<ObjIdent, ObjInfo> ObjNameMap;
+
+
+ // describe schema and write down the information immediatelly using XMLWriter
+void XMLDump::dump_schema(OciEnv& env, const LoginPara& lp, const TCHAR* schema, XMLWriter& writer)
+{
+ OciLogin login(env, lp);
+ OciConnection conn(env, login);
+
+ tstring owner = schema;
+ _tcsupr_s((TCHAR*)owner.data(), owner.length()+1);
+
+ SqlStatement stmt(conn);
+ TCHAR buffer[BUFFER_LEN];
+
+
+ writer.create("schema");
+ writer["name"] = schema;
+
+
+ // Erg\xE4nzung um Zusatzinformationen
+ if (_info) {
+ writer.create("info");
+
+ time_t now = time(NULL); // problems in the year 2038
+#ifdef __STDC_WANT_SECURE_LIB__
+ struct tm lct;
+ localtime_s(&lct, &now);
+ struct tm* plct = &lct;
+#else
+ struct tm* plct = localtime(&now);
+#endif
+ OciDate date(plct);
+ writer["date"] = date.str();
+ writer["dump"] = "xmldump 1.0";
+
+ writer.create("connect");
+ writer["username"] = lp._username;
+ writer["tnsname"] = lp._tnsname;
+ writer.back(); // </connect>
+
+ if (_db_version) {
+ writer.create("db-version");
+#if ORACLE_VERSION>=82
+ int oracle_ver = login._server._version;
+ TCHAR ver_str[32];
+ _stprintf(ver_str, _T("%d.%d.%d.%d.%d"),
+ oracle_ver>>24, (oracle_ver>>20)&0xF,
+ (oracle_ver>>16)&0xF, (oracle_ver>>8)&0xFF, oracle_ver&0xFF);
+ writer["number"] = ver_str;
+#endif
+ writer["string"] = login._server._version_string;
+
+ writer.set_content((LPCTSTR)login._server._version_string);
+ /*
+ SqlStatement stmt(conn, "select BANNER from V$VERSION");
+ //writer["main-string"] = stmt->get_string(0));
+ for(int fetched=stmt.first_bulk(); fetched>0; fetched=stmt.next_bulk())
+ for(int i=0; i<fetched; ++i) {
+ writer.create("line");
+ writer.set_content(stmt->get_string(0, i));
+ writer.back(); </line>
+ }
+ */
+ writer.back(); // </db-version>
+ }
+
+ if (_db_options) {
+ writer.create("db-options");
+ stmt.prepare(_T("select PARAMETER, VALUE from V$OPTION"));
+ stmt.dump_results(writer, "option");
+ writer.back(); // </db-options>
+ }
+
+ writer.back(); // </info>
+ }
+
+
+ typedef map<int, string> TablespaceMap;
+ TablespaceMap tablespaces;
+
+ try {
+ stmt.prepare(_T("select TS#, NAME from V$TABLESPACE"));
+
+ SqlIntArray ts_nr;
+ SqlStringArray ts_name;
+
+ stmt.bind_result(0, ts_nr);
+ stmt.bind_result(1, ts_name);
+
+ stmt.execute(); // throw exception immediatelly if we don't have access to the system view
+
+ writer.create("tablespaces");
+ for(int fetched=stmt.first_bulk(); fetched>0; fetched=stmt.next_bulk())
+ for(int i=0; i<fetched; ++i) {
+ int nr = ts_nr.get_int(i);
+ const char* name = ts_name.c_str(i);
+
+ writer.create("tablespace");
+ writer["nr"] = XMLInt(nr);
+ writer["name"] = name;
+ writer.back();
+
+ tablespaces[nr] = name;
+ }
+ writer.back(); // </tablespaces>
+ } catch(exception&) {
+ // ignore access right exceptions cerr << "Exception: " << e.what() << "\n";
+ }
+
+
+ // query public synonyms
+ if (_pub_syns) {
+ writer.create("public-synonyms");
+
+ SqlString synonym_name, object_name;
+
+ stmt.prepare(_T("select SYNONYM_NAME, TABLE_NAME\n")
+ _T("from ALL_SYNONYMS\n")
+ _T("where owner = 'PUBLIC'\n")
+ _T("and table_owner = :0\n")
+ _T("and db_link is null\n")
+ _T("order by SYNONYM_NAME"));
+
+ stmt.bind_param(0, owner);
+
+ stmt.bind_result(0, synonym_name);
+ stmt.bind_result(1, object_name);
+
+ for(int fetched=stmt.first_bulk(); fetched>0; fetched=stmt.next_bulk())
+ for(int i=0; i<fetched; ++i) {
+ writer.create("public synonym");
+
+ int l = _stprintf(buffer, _T("%s.%s"), owner.c_str(), object_name.c_str());
+
+ writer["name"] = synonym_name;
+ writer["target"] = buffer;
+
+ writer.back();
+ }
+
+ writer.back(); // </public-synonyms>
+ }
+
+
+ writer.create("objects");
+
+ OciDescribe descr(conn._env);
+ sword res = OCIDescribeAny(conn._svc_ctx, conn._env._errh,
+ (void*)schema, _tcslen(schema)*sizeof(TOraText), OCI_OTYPE_NAME,
+ OCI_DEFAULT, OCI_PTYPE_SCHEMA, descr);
+ oci_check_error(conn._env, res);
+
+ OciParam paramh(conn._env);
+ descr.get_attribute(¶mh, NULL, OCI_ATTR_PARAM, conn._env._errh);
+
+ OciParam objlisth(conn._env);
+ paramh.get_attribute(&objlisth, NULL, OCI_ATTR_LIST_OBJECTS);
+
+ ub2 num;
+ objlisth.get_attribute(&num, NULL, OCI_ATTR_NUM_PARAMS);
+
+ // automatische Sortierung der Objekte \xFCber ObjNameMap
+ ObjNameMap obj_names;
+
+ for(int i=0; i<num; ++i) {
+ ObjInfo info;
+ OciParam objh(conn._env);
+ res = OCIParamGet(objlisth, OciParam::get_type_id(), conn._env._errh, (void**)&objh, i);
+ oci_check_error(conn._env, res);
+
+ OraText* name; ub4 name_len;
+ objh.get_attribute(&name, &name_len, OCI_ATTR_OBJ_NAME);
+ tstring obj_name((const TCHAR*)name, name_len);
+
+ // filter by object name
+ if (!_filter.empty() && _filter.find(obj_name)==_filter.end())
+ continue;
+
+ objh.get_attribute(&info._type, NULL, OCI_ATTR_PTYPE);
+
+ if (info._type) { // no "unknown type" nodes
+ tstring type_str = get_oci_ptype_str(info._type);
+
+ // replace spaces by '-' for XML conformity
+ TCHAR* p = (TCHAR*)type_str.data();
+ for(; *p; ++p)
+ if (istspace(*p))
+ *p = '-';
+
+ obj_names[make_pair(type_str, obj_name)] = info;
+ }
+ }
+
+ for(ObjNameMap::const_iterator it=obj_names.begin(); it!=obj_names.end(); ++it) {
+ const ObjIdent& ident = it->first;
+ const tstring& type_str = ident.first;
+ const tstring& obj_name = ident.second;
+ const ObjInfo& info = it->second;
+
+ writer.create(type_str);
+ writer["name"] = obj_name;
+
+ int l = _stprintf(buffer, _T("%s.%s"), owner.c_str(), obj_name.c_str());
+
+ // Not avoidable to describe the object here again - now by name:
+ // Seems, the descriptor handles overflow at some point, so we get an error (msg_id=-1) after some loops.
+ OciDescribe obj_descr(conn._env);
+ res = OCIDescribeAny(conn._svc_ctx, conn._env._errh, (OraText*)buffer, l, OCI_OTYPE_NAME, OCI_DEFAULT, info._type, obj_descr);
+
+ if (res == OCI_SUCCESS) {
+ OciParam paramh(conn._env);
+ obj_descr.get_attribute(¶mh, NULL, OCI_ATTR_PARAM, conn._env._errh);
+
+ // tables (write table attributes before all subnodes)
+ if (info._type == OCI_PTYPE_TABLE) {
+ eword ts_nr;
+ paramh.get_attribute(&ts_nr, NULL, OCI_ATTR_TABLESPACE);
+
+ TablespaceMap::const_iterator found = tablespaces.find(ts_nr);
+
+ if (found != tablespaces.end())
+ writer["tablespace"] = found->second;
+ else
+ writer["tablespace-nr"] = XMLInt(ts_nr);
+
+ ub1 typed, clustered, partitioned, index_only, temporary;
+ paramh.get_attribute(&typed, NULL, OCI_ATTR_IS_TYPED);
+ paramh.get_attribute(&clustered, NULL, OCI_ATTR_CLUSTERED);
+ paramh.get_attribute(&partitioned, NULL, OCI_ATTR_PARTITIONED);
+ paramh.get_attribute(&index_only, NULL, OCI_ATTR_INDEX_ONLY);
+ paramh.get_attribute(&temporary, NULL, OCI_ATTR_IS_TEMPORARY);
+
+ if (typed || clustered || partitioned || index_only || temporary) {
+ writer["type"] = "extended";
+ writer["typed"] = XMLBool(typed? true: false);
+ writer["clustered"] = XMLBool(clustered? true: false);
+ writer["partitioned"] = XMLBool(partitioned? true: false);
+ writer["index_organized"] = XMLBool(index_only? true: false);
+
+ if (temporary) {
+ writer["temporary"] = XMLBool(temporary? true: false);
+
+ OCIDuration duration;
+ paramh.get_attribute(&duration, NULL, OCI_ATTR_DURATION);
+
+ writer["temporary_duration"] =
+ duration==OCI_DURATION_SESSION? "session":
+ duration==OCI_DURATION_TRANS? "transaction":
+ "NULL";
+ }
+ } else
+ writer["type"] = "normal";
+ }
+
+ // tables and views
+ if (info._type==OCI_PTYPE_TABLE || info._type==OCI_PTYPE_VIEW) {
+ // get table/view comments
+ if (_comments) {
+ SqlString comment;
+
+ stmt.prepare(_T("select COMMENTS from ALL_TAB_COMMENTS ")
+ _T("where OWNER=:0 and TABLE_NAME=:1"));
+ stmt.bind_param(0, owner);
+ stmt.bind_param(1, obj_name);
+
+ stmt.bind_result(0, comment);
+
+ stmt.execute_fetch();
+
+ if (stmt.fetched_rows()) {
+ writer.create("comment");
+ writer.set_content(comment.c_str());
+ writer.back();
+ }
+ }
+
+ ColumnType* pcolTypes = NULL;
+ int* pColIdxs = NULL;
+
+ try {
+ ub2 num_cols;
+ paramh.get_attribute(&num_cols, NULL, OCI_ATTR_NUM_COLS);
+
+ OciParam col_listh(conn._env);
+ paramh.get_attribute(&col_listh, NULL, OCI_ATTR_LIST_COLUMNS);
+
+ pcolTypes = new ColumnType[num_cols]; // Array der Spaltenbeschreibungen
+ ColumnType* pColType = pcolTypes;
+
+ pColIdxs = new int[num_cols]; // Array der Spalten-Indices
+ int* pColIdx = pColIdxs;
+
+ int j;
+ for(j=0; j<num_cols; ++j) {
+ OciParam colh(conn._env);
+ res = OCIParamGet(col_listh, OciParam::get_type_id(), conn._env._errh, (void**)&colh, j+1);
+ oci_check_error(conn._env, res);
+
+ pColType++->init(conn._env._errh, colh);
+ *pColIdx++ = j;
+ }
+
+ if (_sort_cols) {
+ s_pcolTypes = pcolTypes; //@@ nicht threadsicher
+ qsort(pColIdxs, num_cols, sizeof(int), cmp_col);
+ }
+
+ map<tstring, tstring> col_comments;
+ map<tstring, tstring> col_default;
+ SqlStringArray col_name, comment, data_default;
+
+ // Abfrage der Spaltenkommentare
+ if (_comments) {
+ stmt.prepare(_T("select COLUMN_NAME, COMMENTS ")
+ _T("from ALL_COL_COMMENTS ")
+ _T("where OWNER=:0 and TABLE_NAME=:1"));
+
+ stmt.bind_param(0, owner);
+ stmt.bind_param(1, obj_name);
+
+ stmt.bind_result(0, col_name);
+ stmt.bind_result(1, comment);
+
+ for(int fetched=stmt.first_bulk(); fetched>0; fetched=stmt.next_bulk())
+ for(int i=0; i<fetched; ++i)
+ if (comment.is_not_null(i))
+ col_comments[col_name.str(i)] = comment.str(i);
+ }
+
+ if (true) {
+ stmt.prepare(_T("select COLUMN_NAME, DATA_DEFAULT ")
+ _T("from ALL_TAB_COLUMNS ")
+ _T("where OWNER=:0 and TABLE_NAME=:1"));
+
+ stmt.bind_param(0, owner);
+ stmt.bind_param(1, obj_name);
+
+ stmt.bind_result(0, col_name);
+ stmt.bind_result(1, data_default);
+
+ for(int fetched=stmt.first_bulk(); fetched>0; fetched=stmt.next_bulk())
+ for(int i=0; i<fetched; ++i)
+ if (data_default.is_not_null(i))
+ col_default[col_name.str(i)] = data_default.str(i);
+ }
+
+ pColIdx = pColIdxs;
+ for(j=0; j<num_cols; ++j) {
+ int k = *pColIdx++;
+ pColType = pcolTypes + k;
+
+ writer.create("column");
+
+ writer["name"] = pColType->_name;
+ writer["type"] = pColType->get_type_str();
+
+ if (_col_pos)
+ writer["pos"] = XMLInt(k+1);
+
+ map<tstring, tstring>::const_iterator found = col_default.find(pColType->_name);
+
+ if (found != col_default.end())
+ writer["default"] = found->second.c_str();
+
+ // Ausgabe des Spaltenkommentars
+ if (_comments) {
+ found = col_comments.find(pColType->_name);
+
+ if (found != col_comments.end()) {
+ writer.create("comment");
+ writer.set_content(found->second.c_str());
+ writer.back();
+ }
+ }
+
+ writer.back(); // </column>
+ }
+
+ delete[] pColIdxs; pColIdxs = NULL;
+ delete[] pcolTypes; pcolTypes = NULL;
+
+
+ // Abfrage der Dateninhalte
+ if (_data) {
+ writer.create("data");
+
+ try {
+ _stprintf(buffer, _T("select * from %s.%s"), schema, obj_name.c_str());
+ stmt.execute(buffer);
+ stmt.dump_results(buffer, writer, "row");
+ } catch(exception& e) {
+ cerr << "====>\n"
+ "exception in dump of '" << ANSI_STRING(obj_name) << "' data: " << e.what() << endl <<
+ "<====\n";
+ }
+
+ writer.back(); // </data>
+ }
+ } catch(exception& e) {
+ cerr << "====>\n"
+ "exception in getting info about '" << ANSI_STRING(obj_name) << "': " << e.what() << endl <<
+ "<====\n";
+
+ delete[] pColIdxs;
+ delete[] pcolTypes;
+ }
+ }
+
+ // views
+ if (info._type == OCI_PTYPE_VIEW) {
+ stmt.prepare(_T("select TEXT from ALL_VIEWS where OWNER=:0 and VIEW_NAME=:1"));
+ stmt.bind_param(0, owner);
+ stmt.bind_param(1, obj_name);
+
+ SqlString view_txt(65536);
+ stmt.bind_result(0, view_txt);
+
+ stmt.execute_fetch();
+
+ if (stmt.fetched_rows() > 0) {
+ writer.create("sql_text");
+ writer.set_content(view_txt.c_str());
+ writer.back(); // </sql_text>
+ }
+
+ // synonyms
+ } else if (info._type == OCI_PTYPE_SYN) {
+ text *syn_schema, *syn_name, *syn_link;
+ ub4 syn_schema_len, syn_name_len, syn_link_len;
+
+ paramh.get_attribute(&syn_schema, &syn_schema_len, OCI_ATTR_SCHEMA_NAME);
+ paramh.get_attribute(&syn_name, &syn_name_len, OCI_ATTR_NAME);
+ paramh.get_attribute(&syn_link, &syn_link_len, OCI_ATTR_LINK);
+
+ int l = _stprintf(buffer, _T("%.*s.%.*s"), syn_schema_len, syn_schema, syn_name_len, syn_name);
+ TCHAR* p = buffer + l;
+
+ if (syn_link)
+#ifdef __STDC_WANT_SECURE_LIB__
+ _stprintf_s(p, COUNTOF(buffer)-l,
+#else
+ _stprintf(p,
+#endif
+ _T("@%.*s"), syn_link_len, syn_link);
+
+ writer["target"] = buffer;
+
+ // sequences
+ } else if (info._type == OCI_PTYPE_SEQ) {
+ ub1* num_ptr;
+
+ ub4 num_len = 0;
+ paramh.get_attribute(&num_ptr, &num_len, OCI_ATTR_MIN);
+ writer["min"] = SqlNumber(num_ptr, num_len).str(conn._env._errh);
+
+ num_len = 0;
+ paramh.get_attribute(&num_ptr, &num_len, OCI_ATTR_MAX);
+ writer["max"] = SqlNumber(num_ptr, num_len).str(conn._env._errh);
+
+ num_len = 0;
+ paramh.get_attribute(&num_ptr, &num_len, OCI_ATTR_INCR);
+ writer["increment"] = SqlNumber(num_ptr, num_len).str(conn._env._errh);
+
+ num_len = 0;
+ paramh.get_attribute(&num_ptr, &num_len, OCI_ATTR_CACHE);
+ writer["cache"] = SqlNumber(num_ptr, num_len).str(conn._env._errh);
+
+ if (_seq_val) {
+ num_len = 0;
+ paramh.get_attribute(&num_ptr, &num_len, OCI_ATTR_HW_MARK);
+ writer["high-water-mark"] = SqlNumber(num_ptr, num_len).str(conn._env._errh);
+ }
+
+ ub1 ordered;
+ paramh.get_attribute(&ordered, NULL, OCI_ATTR_ORDER);
+ writer["ordered"] = XMLBool(ordered? true: false);
+ }
+ } else {
+/* cerr << "====>\n"
+ "exception while describing '" << buffer << "': "
+ << OciException(conn._env._errh, __FILE__, __LINE__).what()
+ << "\n<====\n"; */
+ }
+
+ if (_grants) {
+ // query grants given to this object
+ if (lp._mode & OCI_SYSDBA)
+ stmt.prepare(
+ _T("select GRANTEE, PRIVILEGE ")
+ _T("from DBA_TAB_PRIVS ")
+ _T("where GRANTOR=:0 and TABLE_NAME=:1 ")
+ _T("order by GRANTEE, PRIVILEGE"));
+ else
+ stmt.prepare(
+ _T("select GRANTEE, PRIVILEGE ")
+ _T("from ALL_TAB_PRIVS ")
+ _T("where GRANTOR=:0 and TABLE_NAME=:1 ")
+ _T("order by GRANTEE, PRIVILEGE"));
+
+ writer.create("grants");
+ SqlStringArray grantee, privilege;
+
+ stmt.bind_param(0, owner);
+ stmt.bind_param(1, obj_name);
+
+ stmt.bind_result(0, grantee);
+ stmt.bind_result(1, privilege);
+
+ for(int fetched=stmt.first_bulk(); fetched>0; fetched=stmt.next_bulk())
+ for(int i=0; i<fetched; ++i) {
+ writer.create("grant");
+
+ writer["grantee"] = grantee.str(i);
+ writer["privilege"] = privilege.str(i);
+
+ writer.back(); // </grant>
+ }
+ writer.back(); // </grants>
+ }
+
+ writer.back(); // </...>
+ }
+
+ writer.back(); // </objects>
+
+ writer.back(); // </schema>
+}
Property changes on: trunk/xmldump/xmldump.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/xmldump/xmldump.dsp
===================================================================
--- trunk/xmldump/xmldump.dsp (rev 0)
+++ trunk/xmldump/xmldump.dsp 2008-02-09 15:00:55 UTC (rev 44)
@@ -0,0 +1,132 @@
+# Microsoft Developer Studio Project File - Name="xmldump" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=xmldump - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "xmldump.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "xmldump.mak" CFG="xmldump - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "xmldump - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "xmldump - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.cmd
+RSC=rc.exe
+
+!IF "$(CFG)" == "xmldump - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "."
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "../ocipl" /I "../xmlstorage" /D "NDEBUG" /D "_NO_ESQL" /D "OCIPL_NO_COMMENT" /D "XS_NO_COMMENT" /D ORACLE_VERSION=81 /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x407 /d "NDEBUG"
+# ADD RSC /l 0x407 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.cmd
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib oci.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "xmldump - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../ocipl" /I "../xmlstorage" /D "_DEBUG" /D "_NO_ESQL" /D "OCIPL_NO_COMMENT" /D "XS_NO_COMMENT" /D ORACLE_VERSION=81 /FR /FD /GZ /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x407 /d "_DEBUG"
+# ADD RSC /l 0x407 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.cmd
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 oci.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "xmldump - Win32 Release"
+# Name "xmldump - Win32 Debug"
+# Begin Group "ocipl"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE="..\ocipl\ocipl-xml.cpp"
+# End Source File
+# Begin Source File
+
+SOURCE=..\ocipl\ocipl.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\ocipl\ocipl.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ocipl\ocithrow.cpp
+# End Source File
+# End Group
+# Begin Group "xmlstorage"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\xmlstorage\xmlstorage.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\xmlstorage\xmlstorage.h
+# End Source File
+# Begin Source File
+
+SOURCE="..\xmlstorage\xs-native.cpp"
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=".\xmldump.cpp"
+# End Source File
+# Begin Source File
+
+SOURCE=..\ocipl\xmldump.h
+# End Source File
+# End Target
+# End Project
Property changes on: trunk/xmldump/xmldump.dsp
___________________________________________________________________
Name: svn:eol-style
+ CRLF
Added: trunk/xmldump/xmldump.dsw
===================================================================
--- trunk/xmldump/xmldump.dsw (rev 0)
+++ trunk/xmldump/xmldump.dsw 2008-02-09 15:00:55 UTC (rev 44)
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "xmldump"=.\xmldump.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
Property changes on: trunk/xmldump/xmldump.dsw
___________________________________________________________________
Name: svn:eol-style
+ CRLF
Added: trunk/xmldump/xmldump.h
===================================================================
--- trunk/xmldump/xmldump.h (rev 0)
+++ trunk/xmldump/xmldump.h 2008-02-09 15:00:55 UTC (rev 44)
@@ -0,0 +1,79 @@
+
+ //
+ // xmldump.h
+ //
+ // Copyright (c) 2007 Martin Fuchs <mar...@gm...>
+ //
+
+/*
+
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+
+*/
+
+
+#ifdef UNICODE
+#define ANSI_STRING(s) XS_String(s)
+#else
+#define ANSI_STRING(s) s
+#endif
+
+
+struct XMLDump {
+ bool _info : 1;
+ bool _db_version : 1;
+ bool _db_options : 1;
+
+ bool _tables : 1;
+ bool _views : 1;
+ bool _comments : 1;
+ bool _grants : 1;
+ bool _data : 1;
+ bool _col_pos : 1;
+ bool _seq_val : 1;
+ bool _pub_syns : 1;
+
+ bool _sort_cols : 1;
+
+ std::set<tstring> _filter;
+
+ XMLDump()
+ {
+ _info = true;
+ _db_version = true;
+ _db_options = false;
+ _tables = true;
+ _views = true;
+ _comments = true;
+ _grants = true;
+ _data = false;
+ _col_pos = true;
+ _seq_val = true;
+ _sort_cols = true;
+ _pub_syns = true;
+ }
+
+ void dump_schema(OciEnv& env, const LoginPara& lp, const TCHAR* schema, XMLStorage::XMLWriter& writer);
+};
Property changes on: trunk/xmldump/xmldump.h
___________________________________________________________________
Name: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|