Skip to content

Commit

Permalink
Merge IceXML into IceGrid (#3210)
Browse files Browse the repository at this point in the history
  • Loading branch information
bernardnormier authored Nov 27, 2024
1 parent 997cc9b commit 52a0912
Show file tree
Hide file tree
Showing 26 changed files with 116 additions and 328 deletions.
16 changes: 0 additions & 16 deletions cpp/msbuild/ice.sln
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ice", "..\src\Ice\msbuild\i
{763F88BB-37FD-4BCC-9D13-A7103596EA06} = {763F88BB-37FD-4BCC-9D13-A7103596EA06}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "icexml", "..\src\IceXML\msbuild\icexml.vcxproj", "{90EC26E8-AFFA-4E44-B068-AB5849A96FDD}"
ProjectSection(ProjectDependencies) = postProject
{3AB9772C-6113-4F1C-90FB-5368E7486C11} = {3AB9772C-6113-4F1C-90FB-5368E7486C11}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "glacier2", "..\src\Glacier2Lib\msbuild\glacier2\glacier2.vcxproj", "{2940A3C2-A9BA-44AA-AF65-00479C783407}"
ProjectSection(ProjectDependencies) = postProject
{3AB9772C-6113-4F1C-90FB-5368E7486C11} = {3AB9772C-6113-4F1C-90FB-5368E7486C11}
Expand Down Expand Up @@ -147,7 +142,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "icegridadmin", "..\src\IceG
{142A9562-8DEC-4B1B-9B15-2CAD8304447B} = {142A9562-8DEC-4B1B-9B15-2CAD8304447B}
{3AB9772C-6113-4F1C-90FB-5368E7486C11} = {3AB9772C-6113-4F1C-90FB-5368E7486C11}
{763F88BB-37FD-4BCC-9D13-A7103596EA06} = {763F88BB-37FD-4BCC-9D13-A7103596EA06}
{90EC26E8-AFFA-4E44-B068-AB5849A96FDD} = {90EC26E8-AFFA-4E44-B068-AB5849A96FDD}
{96161748-CE5E-4548-BC1D-AFD2F137A1DC} = {96161748-CE5E-4548-BC1D-AFD2F137A1DC}
{C694B856-3393-41B4-B3DC-3A5AD9A92A3D} = {C694B856-3393-41B4-B3DC-3A5AD9A92A3D}
EndProjectSection
Expand All @@ -158,7 +152,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "icegridnode", "..\src\IceGr
{2940A3C2-A9BA-44AA-AF65-00479C783407} = {2940A3C2-A9BA-44AA-AF65-00479C783407}
{4F8DD63C-3359-42F2-A6A8-80F7D55593AC} = {4F8DD63C-3359-42F2-A6A8-80F7D55593AC}
{763F88BB-37FD-4BCC-9D13-A7103596EA06} = {763F88BB-37FD-4BCC-9D13-A7103596EA06}
{90EC26E8-AFFA-4E44-B068-AB5849A96FDD} = {90EC26E8-AFFA-4E44-B068-AB5849A96FDD}
{9E13C4B5-5DA9-43C1-9304-AEAC035E854D} = {9E13C4B5-5DA9-43C1-9304-AEAC035E854D}
{A28E5839-97F3-4874-BB77-E425787CF2ED} = {A28E5839-97F3-4874-BB77-E425787CF2ED}
{E8ACC848-F7DA-4B29-B52F-81D66E7D397E} = {E8ACC848-F7DA-4B29-B52F-81D66E7D397E}
Expand All @@ -170,7 +163,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "icegridregistry", "..\src\I
{2940A3C2-A9BA-44AA-AF65-00479C783407} = {2940A3C2-A9BA-44AA-AF65-00479C783407}
{4F8DD63C-3359-42F2-A6A8-80F7D55593AC} = {4F8DD63C-3359-42F2-A6A8-80F7D55593AC}
{763F88BB-37FD-4BCC-9D13-A7103596EA06} = {763F88BB-37FD-4BCC-9D13-A7103596EA06}
{90EC26E8-AFFA-4E44-B068-AB5849A96FDD} = {90EC26E8-AFFA-4E44-B068-AB5849A96FDD}
{9E13C4B5-5DA9-43C1-9304-AEAC035E854D} = {9E13C4B5-5DA9-43C1-9304-AEAC035E854D}
{A28E5839-97F3-4874-BB77-E425787CF2ED} = {A28E5839-97F3-4874-BB77-E425787CF2ED}
EndProjectSection
Expand Down Expand Up @@ -302,14 +294,6 @@ Global
{3AB9772C-6113-4F1C-90FB-5368E7486C11}.Release|Win32.Build.0 = Release|Win32
{3AB9772C-6113-4F1C-90FB-5368E7486C11}.Release|x64.ActiveCfg = Release|x64
{3AB9772C-6113-4F1C-90FB-5368E7486C11}.Release|x64.Build.0 = Release|x64
{90EC26E8-AFFA-4E44-B068-AB5849A96FDD}.Debug|Win32.ActiveCfg = Debug|Win32
{90EC26E8-AFFA-4E44-B068-AB5849A96FDD}.Debug|Win32.Build.0 = Debug|Win32
{90EC26E8-AFFA-4E44-B068-AB5849A96FDD}.Debug|x64.ActiveCfg = Debug|x64
{90EC26E8-AFFA-4E44-B068-AB5849A96FDD}.Debug|x64.Build.0 = Debug|x64
{90EC26E8-AFFA-4E44-B068-AB5849A96FDD}.Release|Win32.ActiveCfg = Release|Win32
{90EC26E8-AFFA-4E44-B068-AB5849A96FDD}.Release|Win32.Build.0 = Release|Win32
{90EC26E8-AFFA-4E44-B068-AB5849A96FDD}.Release|x64.ActiveCfg = Release|x64
{90EC26E8-AFFA-4E44-B068-AB5849A96FDD}.Release|x64.Build.0 = Release|x64
{2940A3C2-A9BA-44AA-AF65-00479C783407}.Debug|Win32.ActiveCfg = Debug|Win32
{2940A3C2-A9BA-44AA-AF65-00479C783407}.Debug|Win32.Build.0 = Debug|Win32
{2940A3C2-A9BA-44AA-AF65-00479C783407}.Debug|x64.ActiveCfg = Debug|x64
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/IceGrid/AdminI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ AdminI::getDefaultApplicationDescriptor(const Current& current) const
{
desc = DescriptorParser::parseDescriptor(path, current.adapter->getCommunicator());
}
catch (const IceXML::ParserException& ex)
catch (const XMLParserException& ex)
{
throw DeploymentException("can't parse default templates:\n" + string{ex.what()});
}
Expand Down
10 changes: 5 additions & 5 deletions cpp/src/IceGrid/DescriptorBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ using namespace std;
using namespace IceGrid;

XmlAttributesHelper::XmlAttributesHelper(
const IceXML::Attributes& attrs,
const XMLAttributes& attrs,
const Ice::LoggerPtr& logger,
const string& filename,
int line)
Expand Down Expand Up @@ -57,7 +57,7 @@ string
XmlAttributesHelper::operator()(const string& name) const
{
_used.insert(name);
IceXML::Attributes::const_iterator p = _attributes.find(name);
XMLAttributes::const_iterator p = _attributes.find(name);
if (p == _attributes.end())
{
throw invalid_argument("missing attribute '" + name + "'");
Expand All @@ -74,7 +74,7 @@ string
XmlAttributesHelper::operator()(const string& name, const string& def) const
{
_used.insert(name);
IceXML::Attributes::const_iterator p = _attributes.find(name);
XMLAttributes::const_iterator p = _attributes.find(name);
if (p == _attributes.end())
{
return def;
Expand All @@ -99,7 +99,7 @@ bool
XmlAttributesHelper::asBool(const string& name) const
{
_used.insert(name);
IceXML::Attributes::const_iterator p = _attributes.find(name);
XMLAttributes::const_iterator p = _attributes.find(name);
if (p == _attributes.end())
{
throw invalid_argument("missing attribute '" + name + "'");
Expand All @@ -122,7 +122,7 @@ bool
XmlAttributesHelper::asBool(const string& name, bool def) const
{
_used.insert(name);
IceXML::Attributes::const_iterator p = _attributes.find(name);
XMLAttributes::const_iterator p = _attributes.find(name);
if (p == _attributes.end())
{
return def;
Expand Down
6 changes: 3 additions & 3 deletions cpp/src/IceGrid/DescriptorBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
#ifndef ICEGRID_DESCRIPTOR_BUILDER_H
#define ICEGRID_DESCRIPTOR_BUILDER_H

#include "../IceXML/Parser.h"
#include "Ice/Logger.h"
#include "IceGrid/Descriptor.h"
#include "XMLParser.h"
#include <set>

namespace IceGrid
{
class XmlAttributesHelper
{
public:
XmlAttributesHelper(const IceXML::Attributes&, const Ice::LoggerPtr&, const std::string&, int);
XmlAttributesHelper(const XMLAttributes&, const Ice::LoggerPtr&, const std::string&, int);

void checkUnknownAttributes();
bool contains(const std::string&) const;
Expand All @@ -28,7 +28,7 @@ namespace IceGrid
std::string operator()(const std::string&, const std::string&) const;

private:
const IceXML::Attributes& _attributes;
const XMLAttributes& _attributes;
const Ice::LoggerPtr _logger;
const std::string _filename;
const int _line;
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/IceGrid/DescriptorHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
#define ICEGRID_DESCRIPTOR_HELPER_H

#include "../Ice/OutputUtil.h"
#include "../IceXML/Parser.h"
#include "IceGrid/Admin.h"
#include "Internal.h"
#include "XMLParser.h"
#include <set>

namespace IceGrid
Expand Down
18 changes: 9 additions & 9 deletions cpp/src/IceGrid/DescriptorParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
//

#include "DescriptorParser.h"
#include "../IceXML/Parser.h"
#include "DescriptorBuilder.h"
#include "Ice/Ice.h"
#include "IceGrid/Admin.h"
#include "Util.h"
#include "XMLParser.h"

#include <fstream>
#include <stack>
Expand All @@ -18,15 +18,15 @@ using namespace IceGrid;

namespace
{
class DescriptorHandler final : public IceXML::Handler
class DescriptorHandler final : public XMLHandler
{
public:
DescriptorHandler(const string&, const shared_ptr<Ice::Communicator>&);

void setAdmin(IceGrid::AdminPrx);
void setVariables(const map<string, string>&, const vector<string>&);

void startElement(const string&, const IceXML::Attributes&, int, int) override;
void startElement(const string&, const XMLAttributes&, int, int) override;
void endElement(const string&, int, int) override;
void characters(const string&, int, int) override;
void error(const string&, int, int) override;
Expand Down Expand Up @@ -86,7 +86,7 @@ namespace
_targets = targets;
}

void DescriptorHandler::startElement(const string& name, const IceXML::Attributes& attrs, int line, int column)
void DescriptorHandler::startElement(const string& name, const XMLAttributes& attrs, int line, int column)
{
_line = line;
_column = column;
Expand Down Expand Up @@ -147,7 +147,7 @@ namespace
_filename = file;
_targets = getTargets(targets);

IceXML::Parser::parse(file, *this);
XMLParser::parse(file, *this);

_filename = oldFileName;
_targets = oldTargets;
Expand Down Expand Up @@ -636,7 +636,7 @@ namespace
{
ostringstream os;
os << "error in <" << _filename << "> descriptor, line " << line << ", column " << column << ":\n" << msg;
throw IceXML::ParserException(__FILE__, __LINE__, os.str());
throw XMLParserException(__FILE__, __LINE__, os.str());
}

const ApplicationDescriptor& DescriptorHandler::getApplicationDescriptor() const
Expand Down Expand Up @@ -682,7 +682,7 @@ namespace
{
ostringstream os;
os << "error in <" << _filename << "> descriptor, line " << _line << ", column " << _column << ":\n" << msg;
throw IceXML::ParserException(__FILE__, __LINE__, os.str());
throw XMLParserException(__FILE__, __LINE__, os.str());
}

string DescriptorHandler::elementValue()
Expand Down Expand Up @@ -778,7 +778,7 @@ DescriptorParser::parseDescriptor(
DescriptorHandler handler(filename, communicator);
handler.setAdmin(std::move(admin));
handler.setVariables(variables, targets);
IceXML::Parser::parse(filename, handler);
XMLParser::parse(filename, handler);
return handler.getApplicationDescriptor();
}

Expand All @@ -787,6 +787,6 @@ DescriptorParser::parseDescriptor(const string& descriptor, const shared_ptr<Ice
{
string filename = simplify(descriptor);
DescriptorHandler handler(filename, communicator);
IceXML::Parser::parse(filename, handler);
XMLParser::parse(filename, handler);
return handler.getApplicationDescriptor();
}
4 changes: 2 additions & 2 deletions cpp/src/IceGrid/FileParserI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
//

#include "FileParserI.h"
#include "../IceXML/Parser.h"
#include "DescriptorParser.h"
#include "Ice/ObjectAdapter.h"
#include "XMLParser.h"

using namespace std;
using namespace IceGrid;
Expand All @@ -23,7 +23,7 @@ FileParserI::parse(string file, optional<AdminPrx> admin, const Ice::Current& cu
current.adapter->getCommunicator(),
*std::move(admin));
}
catch (const IceXML::ParserException& e)
catch (const XMLParserException& e)
{
throw ParseException(e.what());
}
Expand Down
18 changes: 12 additions & 6 deletions cpp/src/IceGrid/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ local_node_srcs = Activator.cpp \
NodeI.cpp \
NodeSessionManager.cpp \
ServerAdapterI.cpp \
ServerI.cpp
ServerI.cpp \
XMLParser.cpp

local_registry_srcs = Internal.ice \
AdminRouter.cpp \
Expand Down Expand Up @@ -46,7 +47,8 @@ local_registry_srcs = Internal.ice \
SynchronizationException.cpp \
Topics.cpp \
Util.cpp \
WellKnownObjectsManager.cpp
WellKnownObjectsManager.cpp \
XMLParser.cpp

local_admin_srcs = Internal.ice \
Client.cpp \
Expand All @@ -57,7 +59,8 @@ local_admin_srcs = Internal.ice \
Grammar.cpp \
Parser.cpp \
Scanner.cpp \
Util.cpp
Util.cpp \
XMLParser.cpp

$(project)_programs = icegridnode icegridregistry icegridadmin
$(project)_dependencies := IceGrid Glacier2 Ice
Expand All @@ -69,13 +72,16 @@ $(project)_cppflags := $(if $(lmdb_includedir),-I$(lmdb_includedir))

icegridnode_sources := $(addprefix $(currentdir)/,$(local_node_srcs) $(local_registry_srcs) IceGridNode.cpp) \
$(slicedir)/IceLocatorDiscovery/IceLocatorDiscovery.ice
icegridnode_dependencies := IceBox IceStormService IceStorm IceXML IceDB
icegridnode_dependencies := IceBox IceStormService IceStorm IceDB
icegridnode_libs := expat

icegridregistry_sources := $(addprefix $(currentdir)/,$(local_registry_srcs) IceGridRegistry.cpp) \
$(slicedir)/IceLocatorDiscovery/IceLocatorDiscovery.ice
icegridregistry_dependencies := IceBox IceStormService IceStorm IceXML IceDB $(local_dependencies)
icegridregistry_dependencies := IceBox IceStormService IceStorm IceDB $(local_dependencies)
icegridregistry_libs := expat

icegridadmin_sources := $(addprefix $(currentdir)/,$(local_admin_srcs))
icegridadmin_dependencies := IceBox IceXML IceLocatorDiscovery
icegridadmin_dependencies := IceBox IceLocatorDiscovery
icegridadmin_libs := expat

projects += $(project)
6 changes: 3 additions & 3 deletions cpp/src/IceGrid/Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Copyright (c) ZeroC, Inc. All rights reserved.
//

#include "../IceXML/Parser.h"
#include "Parser.h"
#include "../Ice/ConsoleUtil.h"
#include "../Ice/DisableWarnings.h"
#include "../Ice/Options.h"
Expand All @@ -11,8 +11,8 @@
#include "DescriptorParser.h"
#include "Ice/Ice.h"
#include "IceBox/IceBox.h"
#include "Parser.h"
#include "Util.h"
#include "XMLParser.h"

#if defined(__APPLE__) || defined(__linux__)
# include <editline/readline.h>
Expand Down Expand Up @@ -2680,7 +2680,7 @@ Parser::exception(std::exception_ptr pex)
{
error("couldn't access file:\n" + ex.reason);
}
catch (const IceXML::ParserException& ex)
catch (const XMLParserException& ex)
{
ostringstream s;
s << ex;
Expand Down
Loading

0 comments on commit 52a0912

Please sign in to comment.