diff options
-rw-r--r-- | cpp/all.dsw | 21 | ||||
-rw-r--r-- | cpp/src/Makefile | 1 | ||||
-rw-r--r-- | cpp/src/slice2wsdl/.depend | 2 | ||||
-rw-r--r-- | cpp/src/slice2wsdl/Gen.cpp | 229 | ||||
-rw-r--r-- | cpp/src/slice2wsdl/Gen.h | 63 | ||||
-rw-r--r-- | cpp/src/slice2wsdl/Main.cpp | 225 | ||||
-rw-r--r-- | cpp/src/slice2wsdl/Makefile | 38 | ||||
-rw-r--r-- | cpp/src/slice2wsdl/slice2wsdl.dsp | 125 |
8 files changed, 0 insertions, 704 deletions
diff --git a/cpp/all.dsw b/cpp/all.dsw index 1419167ab74..e9ad51853ca 100644 --- a/cpp/all.dsw +++ b/cpp/all.dsw @@ -801,9 +801,6 @@ Package=<4> Project_Dep_Name unicode
End Project Dependency
Begin Project Dependency
- Project_Dep_Name slice2wsdl
- End Project Dependency
- Begin Project Dependency
Project_Dep_Name Glacier
End Project Dependency
Begin Project Dependency
@@ -2736,24 +2733,6 @@ Package=<4> ###############################################################################
-Project: "slice2wsdl"=.\src\slice2wsdl\slice2wsdl.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name IceUtil
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name Slice
- End Project Dependency
-}}}
-
-###############################################################################
-
Project: "sliceexAMDS"=.\test\Ice\slicing\exceptions\sliceexAMDS.dsp - Package Owner=<4>
Package=<5>
diff --git a/cpp/src/Makefile b/cpp/src/Makefile index 36b90f366c1..9bce3dc9361 100644 --- a/cpp/src/Makefile +++ b/cpp/src/Makefile @@ -25,7 +25,6 @@ SUBDIRS = IceUtil \ slice2freezej \ slice2docbook \ slice2java \ - slice2wsdl \ Ice \ IceXML \ IceSSL \ diff --git a/cpp/src/slice2wsdl/.depend b/cpp/src/slice2wsdl/.depend deleted file mode 100644 index b876521b746..00000000000 --- a/cpp/src/slice2wsdl/.depend +++ /dev/null @@ -1,2 +0,0 @@ -Gen.o: Gen.cpp ../../include/IceUtil/Functional.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/IceUtil/Config.h ../../include/IceUtil/OutputUtil.h ../../include/Slice/CPlusPlusUtil.h ../../include/Slice/Parser.h ../../include/IceUtil/Shared.h ../../include/IceUtil/InputUtil.h Gen.h -Main.o: Main.cpp ../../include/Slice/Preprocessor.h ../../include/IceUtil/Config.h Gen.h ../../include/Slice/Parser.h ../../include/IceUtil/Shared.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/IceUtil/InputUtil.h diff --git a/cpp/src/slice2wsdl/Gen.cpp b/cpp/src/slice2wsdl/Gen.cpp deleted file mode 100644 index 85f54478d5a..00000000000 --- a/cpp/src/slice2wsdl/Gen.cpp +++ /dev/null @@ -1,229 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003 -// ZeroC, Inc. -// Billerica, MA, USA -// -// All Rights Reserved. -// -// Ice is free software; you can redistribute it and/or modify it under -// the terms of the GNU General Public License version 2 as published by -// the Free Software Foundation. -// -// ********************************************************************** - -#include <IceUtil/Functional.h> -#include <IceUtil/OutputUtil.h> - -#include <Slice/CPlusPlusUtil.h> // TODO: ??? - -#include <Gen.h> - -using namespace std; -using namespace Slice; -using namespace IceUtil; - -static const string internalId = "_internal."; - -Slice::Gen::Gen(const string& name, const string& base, const string& include, - const vector<string>& includePaths, const string& dir) : - _name(name), - _base(base), - _include(include), - _includePaths(includePaths), - _dir(dir) -{ - _orgName = "http://www.noorg.org"; // TODO: argument! - for(vector<string>::iterator p = _includePaths.begin(); p != _includePaths.end(); ++p) - { - if(p->length() && (*p)[p->length() - 1] != '/') - { - *p += '/'; - } - } - - string::size_type pos = _base.rfind('/'); - if(pos != string::npos) - { - _base.erase(0, pos + 1); - } -} - -Slice::Gen::~Gen() -{ -} - -bool -Slice::Gen::visitClassDefStart(const ClassDefPtr& p) -{ - XMLOutput O; - - //string fileO = _base + ".wsdl"; - string fileO = containedToId(p) + p->name() + ".wsdl"; - if(!_dir.empty()) - { - fileO = _dir + '/' + fileO; - } - - O.open(fileO.c_str()); - if(!O) - { - cerr << _name << ": can't open `" << fileO << "' for writing: " << strerror(errno) << endl; - return false; - } - - printHeader(O); - O << "\n<!-- Generated from file `" << changeInclude(_base, _includePaths) << ".ice' -->\n"; - - string scopeId = containedToId(p); - - // - // TODO: It would be better if start() aligned the attributes - // correctly. - // - ostringstream os; - os << "wsdl:definitions name=\"" << scopeId << p->name() << "\"" - << "\n xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\"" - << "\n xmlns:xsd1=\"" << _orgName << "/schemas\"" - << "\n xmlns:tns=\"" << _orgName << "/definitions\"" - << "\n targetNamespace=\"" << _orgName << "/definitions\""; - - O << se(os.str()); - - // TODO: schemaLocation? - O << sp << nl << "<wsdl:import namespace=\"" << _orgName << "/schemas\" location=\"" << _base << ".xsd\"/>"; - - - OperationList ops = p->allOperations(); - for(OperationList::const_iterator q = ops.begin(); q != ops.end(); ++q) - { - emitMessage(O, *q); - } - - O << sp; - - os.str(""); - os << "wsdl:portType name=\"" << scopeId << "PortType\""; - O << se(os.str()); - - for(OperationList::const_iterator r = ops.begin(); r != ops.end(); ++r) - { - emitOperation(O, *r); - } - - O << ee; // PortType - - O << ee; // definitions - - return false; -} - -void -Slice::Gen::emitMessage(XMLOutput& O, const OperationPtr& p) -{ - O << sp; - - string scopeId = containedToId(p); - - ostringstream os; - os << "wsdl:message name=\"input." << p->name() << "\""; - O << se(os.str()); - - O << nl << "<wsdl:part name=\"body\" element=\"xsd1:" << scopeId << "request." << p->name() << "\"/>"; - - O << ee; // message - - os.str(""); - os << "wsdl:message name=\"output." << p->name() << "\""; - O << se(os.str()); - - O << nl << "<wsdl:part name=\"body\" element=\"xsd1:" << scopeId << "reply." << p->name() << "\"/>"; - - O << ee; // message - - os.str(""); - os << "wsdl:message name=\"metadata." << p->name() << "\""; - O << se(os.str()); - - list<string> metaData = p->getMetaData(); - for(list<string>::iterator iter = metaData.begin(); iter != metaData.end(); ++iter) - { - O << nl << "<wsdl:part name=\"" << *iter << "\"/>"; - } - - O << ee; // message -} - -void -Slice::Gen::emitOperation(XMLOutput& O, const OperationPtr& p) -{ - string scopeId = containedToId(p); - - ostringstream os; - os << "wsdl:operation name=\"" << p->name() << "\""; - O << se(os.str()); - - O << nl << "<wsdl:input message=\"tns:input." << p->name() << "\"/>"; - O << nl << "<wsdl:output message=\"tns:output." << p->name() << "\"/>"; - - O << ee; // operation -} - -void -Slice::Gen::printHeader(XMLOutput& O) -{ - static const char* header = -"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" -"<!--\n" -"**********************************************************************\n" -"Copyright (c) 2003\n" -"ZeroC, Inc.\n" -"Billerica, MA, USA\n" -"\n" -"All Rights Reserved.\n" -"\n" -"Ice is free software; you can redistribute it and/or modify it under\n" -"the terms of the GNU General Public License version 2 as published by\n" -"the Free Software Foundation.\n" -"\n" -"Generated by the `slice2wsdl' converter\n" -"**********************************************************************\n" -"-->"; - - O.zeroIndent(); - O << header; - O << "\n<!-- Ice version " << ICE_STRING_VERSION << " -->"; - O.restoreIndent(); -} - - -string -Slice::Gen::containedToId(const ContainedPtr& contained) -{ - assert(contained); - - string scoped = contained->scope(); - if(scoped[0] == ':') - { - scoped.erase(0, 2); - } - - string id; - - id.reserve(scoped.size()); - - for(unsigned int i = 0; i < scoped.size(); ++i) - { - if(scoped[i] == ':') - { - id += '.'; - ++i; - } - else - { - id += scoped[i]; - } - } - - return id; -} diff --git a/cpp/src/slice2wsdl/Gen.h b/cpp/src/slice2wsdl/Gen.h deleted file mode 100644 index d08ab203f29..00000000000 --- a/cpp/src/slice2wsdl/Gen.h +++ /dev/null @@ -1,63 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003 -// ZeroC, Inc. -// Billerica, MA, USA -// -// All Rights Reserved. -// -// Ice is free software; you can redistribute it and/or modify it under -// the terms of the GNU General Public License version 2 as published by -// the Free Software Foundation. -// -// ********************************************************************** - -#ifndef GEN_H -#define GEN_H - -#include <Slice/Parser.h> -#include <stack> - -namespace IceUtil -{ - -class XMLOutput; - -} - -namespace Slice -{ - -class Gen : public ::IceUtil::noncopyable, public ParserVisitor -{ -public: - - Gen(const std::string&, - const std::string&, - const std::string&, - const std::vector<std::string>&, - const std::string&); - virtual ~Gen(); - - virtual bool visitClassDefStart(const ClassDefPtr&); - -private: - - void emitMessage(::IceUtil::XMLOutput&, const OperationPtr&); - void emitOperation(::IceUtil::XMLOutput&, const OperationPtr&); - - void printHeader(::IceUtil::XMLOutput&); - - std::string containedToId(const ContainedPtr&); - - std::string _name; - std::string _base; - std::string _include; - std::string _orgName; - std::vector<std::string> _includePaths; - std::string _dir; -}; - -} - -#endif diff --git a/cpp/src/slice2wsdl/Main.cpp b/cpp/src/slice2wsdl/Main.cpp deleted file mode 100644 index 969ae986e4e..00000000000 --- a/cpp/src/slice2wsdl/Main.cpp +++ /dev/null @@ -1,225 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003 -// ZeroC, Inc. -// Billerica, MA, USA -// -// All Rights Reserved. -// -// Ice is free software; you can redistribute it and/or modify it under -// the terms of the GNU General Public License version 2 as published by -// the Free Software Foundation. -// -// ********************************************************************** - -#include <Slice/Preprocessor.h> -#include <Gen.h> - -using namespace std; -using namespace Slice; - -void -usage(const char* n) -{ - cerr << "Usage: " << n << " [options] slice-file [type-id ...]\n"; - cerr << - "Options:\n" - "-h, --help Show this message.\n" - "-v, --version Display the Ice version.\n" - "-DNAME Define NAME as 1.\n" - "-DNAME=DEF Define NAME as DEF.\n" - "-UNAME Remove any definition for NAME.\n" - "-IDIR Put DIR in the include file search path.\n" - "-d, --debug Print debug messages.\n" - "--ice Permit `Ice' prefix (for building Ice source code only)\n" - ; - // Note: --case-sensitive is intentionally not shown here! -} - -int -main(int argc, char* argv[]) -{ - string cppArgs; - bool debug = false; - bool ice = false; - bool caseSensitive = false; - string include; - string output; - vector<string> includePaths; - - int idx = 1; - while(idx < argc) - { - if(strncmp(argv[idx], "-I", 2) == 0) - { - cppArgs += ' '; - cppArgs += argv[idx]; - - string path = argv[idx] + 2; - if(path.length()) - { - includePaths.push_back(path); - } - - for(int i = idx ; i + 1 < argc ; ++i) - { - argv[i] = argv[i + 1]; - } - --argc; - } - else if(strncmp(argv[idx], "-D", 2) == 0 || strncmp(argv[idx], "-U", 2) == 0) - { - cppArgs += ' '; - cppArgs += argv[idx]; - - for(int i = idx ; i + 1 < argc ; ++i) - { - argv[i] = argv[i + 1]; - } - --argc; - } - else if(strcmp(argv[idx], "-h") == 0 || strcmp(argv[idx], "--help") == 0) - { - usage(argv[0]); - return EXIT_SUCCESS; - } - else if(strcmp(argv[idx], "-v") == 0 || strcmp(argv[idx], "--version") == 0) - { - cout << ICE_STRING_VERSION << endl; - return EXIT_SUCCESS; - } - else if(strcmp(argv[idx], "-d") == 0 || strcmp(argv[idx], "--debug") == 0) - { - debug = true; - for(int i = idx ; i + 1 < argc ; ++i) - { - argv[i] = argv[i + 1]; - } - --argc; - } - else if(strcmp(argv[idx], "--ice") == 0) - { - ice = true; - for(int i = idx ; i + 1 < argc ; ++i) - { - argv[i] = argv[i + 1]; - } - --argc; - } - else if(strcmp(argv[idx], "--case-sensitive") == 0) - { - caseSensitive = true; - for(int i = idx ; i + 1 < argc ; ++i) - { - argv[i] = argv[i + 1]; - } - --argc; - } - else if(strcmp(argv[idx], "--include-dir") == 0) - { - if(idx + 1 >= argc) - { - cerr << argv[0] << ": argument expected for`" << argv[idx] << "'" << endl; - usage(argv[0]); - return EXIT_FAILURE; - } - - include = argv[idx + 1]; - for(int i = idx ; i + 2 < argc ; ++i) - { - argv[i] = argv[i + 2]; - } - argc -= 2; - } - else if(strcmp(argv[idx], "--output-dir") == 0) - { - if(idx + 1 >= argc) - { - cerr << argv[0] << ": argument expected for`" << argv[idx] << "'" << endl; - usage(argv[0]); - return EXIT_FAILURE; - } - - output = argv[idx + 1]; - for(int i = idx ; i + 2 < argc ; ++i) - { - argv[i] = argv[i + 2]; - } - argc -= 2; - } - else if(argv[idx][0] == '-') - { - cerr << argv[0] << ": unknown option `" << argv[idx] << "'" << endl; - usage(argv[0]); - return EXIT_FAILURE; - } - else - { - ++idx; - } - } - - if(argc < 2) - { - usage(argv[0]); - return EXIT_FAILURE; - } - - string sourceFile = argv[1]; - - int status = EXIT_SUCCESS; - - Preprocessor icecpp(argv[0], sourceFile, cppArgs); - FILE* cppHandle = icecpp.preprocess(true); - - if(cppHandle == 0) - { - return EXIT_FAILURE; - } - - UnitPtr p = Unit::createUnit(false, false, ice, caseSensitive); - int parseStatus = p->parse(cppHandle, debug); - - if(!icecpp.close()) - { - p->destroy(); - return EXIT_FAILURE; - } - - if(parseStatus == EXIT_FAILURE) - { - status = EXIT_FAILURE; - } - else - { - Gen gen(argv[0], icecpp.getBaseName(), include, includePaths, output); - - if(argc > 2) - { - for(idx = 2 ; idx < argc; ++idx) - { - ClassDeclPtr classDecl; - TypeList classTypes = p->lookupType(argv[idx], false); - if(!classTypes.empty()) - { - classDecl = ClassDeclPtr::dynamicCast(classTypes.front()); - } - if(!classDecl) - { - cerr << argv[0] << ": invalid type: " << argv[idx] << endl; - status = EXIT_FAILURE; - break; - } - gen.visitClassDefStart(classDecl->definition()); - } - } - else - { - p->visit(&gen); - } - } - - p->destroy(); - - return status; -} diff --git a/cpp/src/slice2wsdl/Makefile b/cpp/src/slice2wsdl/Makefile deleted file mode 100644 index 09d3d1b0d95..00000000000 --- a/cpp/src/slice2wsdl/Makefile +++ /dev/null @@ -1,38 +0,0 @@ -# ********************************************************************** -# -# Copyright (c) 2003 -# ZeroC, Inc. -# Billerica, MA, USA -# -# All Rights Reserved. -# -# Ice is free software; you can redistribute it and/or modify it under -# the terms of the GNU General Public License version 2 as published by -# the Free Software Foundation. -# -# ********************************************************************** - -top_srcdir = ../.. - -NAME = $(top_srcdir)/bin/slice2wsdl - -TARGETS = $(NAME) - -OBJS = Gen.o \ - Main.o - -SRCS = $(OBJS:.o=.cpp) \ - $(VOBJS:.o=.cpp) - -include $(top_srcdir)/config/Make.rules - -CPPFLAGS := -I. $(CPPFLAGS) - -$(NAME): $(OBJS) - rm -f $@ - $(CXX) $(LDFLAGS) -o $@ $(OBJS) -lSlice $(BASELIBS) - -install:: all - $(INSTALL_PROGRAM) $(NAME) $(install_bindir) - -include .depend diff --git a/cpp/src/slice2wsdl/slice2wsdl.dsp b/cpp/src/slice2wsdl/slice2wsdl.dsp deleted file mode 100644 index 00515745514..00000000000 --- a/cpp/src/slice2wsdl/slice2wsdl.dsp +++ /dev/null @@ -1,125 +0,0 @@ -# Microsoft Developer Studio Project File - Name="slice2wsdl" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=slice2wsdl - 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 "slice2wsdl.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 "slice2wsdl.mak" CFG="slice2wsdl - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "slice2wsdl - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "slice2wsdl - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "slice2wsdl - 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 "Release"
-# 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 /MD /W3 /WX /GR /GX /O2 /I "." /I "../../include" /D "NDEBUG" /D "_CONSOLE" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# 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 setargv.obj /nologo /subsystem:console /machine:I386
-# Begin Special Build Tool
-OutDir=.\Release
-TargetName=slice2wsdl
-SOURCE="$(InputPath)"
-PostBuild_Cmds=copy $(OutDir)\$(TargetName).exe ..\..\bin
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "slice2wsdl - 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 /WX /Gm /GR /GX /Zi /Od /I "." /I "../../include" /D "_DEBUG" /D "_CONSOLE" /FD /GZ /c
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# 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 setargv.obj /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# SUBTRACT LINK32 /pdb:none
-# Begin Special Build Tool
-OutDir=.\Debug
-TargetName=slice2wsdl
-SOURCE="$(InputPath)"
-PostBuild_Cmds=copy $(OutDir)\$(TargetName).exe ..\..\bin
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "slice2wsdl - Win32 Release"
-# Name "slice2wsdl - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\Gen.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Main.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\Gen.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
|