summaryrefslogtreecommitdiff
path: root/cpp/src/slice2confluence
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2016-05-03 19:26:09 +0200
committerBenoit Foucher <benoit@zeroc.com>2016-05-03 19:26:09 +0200
commitee3b7be185f7d887a33b9c242a7ccd08a09d2614 (patch)
tree1974211a0cbd5e3df95b6deed0b2b42f7854aca9 /cpp/src/slice2confluence
parentRename files for consistency (diff)
downloadice-ee3b7be185f7d887a33b9c242a7ccd08a09d2614.tar.bz2
ice-ee3b7be185f7d887a33b9c242a7ccd08a09d2614.tar.xz
ice-ee3b7be185f7d887a33b9c242a7ccd08a09d2614.zip
Re-factored gmake build system
Diffstat (limited to 'cpp/src/slice2confluence')
-rw-r--r--cpp/src/slice2confluence/.gitignore4
-rw-r--r--cpp/src/slice2confluence/ConfluenceOutput.cpp4
-rw-r--r--cpp/src/slice2confluence/ConfluenceOutput.h54
-rw-r--r--cpp/src/slice2confluence/Main.cpp14
-rw-r--r--cpp/src/slice2confluence/Makefile31
5 files changed, 36 insertions, 71 deletions
diff --git a/cpp/src/slice2confluence/.gitignore b/cpp/src/slice2confluence/.gitignore
deleted file mode 100644
index 3a412ca89c7..00000000000
--- a/cpp/src/slice2confluence/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-// Generated by makegitignore.py
-
-// IMPORTANT: Do not edit this file -- any edits made here will be lost!
-.depend
diff --git a/cpp/src/slice2confluence/ConfluenceOutput.cpp b/cpp/src/slice2confluence/ConfluenceOutput.cpp
index 32786fed6fe..a1176f7cc37 100644
--- a/cpp/src/slice2confluence/ConfluenceOutput.cpp
+++ b/cpp/src/slice2confluence/ConfluenceOutput.cpp
@@ -51,7 +51,7 @@ Confluence::ConfluenceOutput::ConfluenceOutput(const char* s) :
}
void
-Confluence::ConfluenceOutput::print(const char* s)
+Confluence::ConfluenceOutput::print(const string& s)
{
if(_se)
{
@@ -62,7 +62,7 @@ Confluence::ConfluenceOutput::print(const char* s)
if(_escape)
{
string escaped = escape(s);
- OutputBase::print(escaped.c_str());
+ OutputBase::print(escaped);
}
else
{
diff --git a/cpp/src/slice2confluence/ConfluenceOutput.h b/cpp/src/slice2confluence/ConfluenceOutput.h
index 90d02809368..a97577c39c5 100644
--- a/cpp/src/slice2confluence/ConfluenceOutput.h
+++ b/cpp/src/slice2confluence/ConfluenceOutput.h
@@ -15,59 +15,59 @@ namespace Confluence
class ConfluenceOutput : public IceUtilInternal::OutputBase
{
public:
-
+
ConfluenceOutput();
ConfluenceOutput(std::ostream&);
ConfluenceOutput(const char*);
-
+
virtual ~ConfluenceOutput(){};
-
- virtual void print(const char*); // Print a string.
-
+
+ virtual void print(const std::string&); // Print a string.
+
virtual void newline(); // Print newline.
-
+
void startElement(const std::string&); // Start an element.
void endElement(); // End an element.
void attr(const std::string&, const std::string&); // Add an attribute to an element.
-
+
std::string convertCommentHTML(std::string comment);
std::string escapeComment(std::string comment);
-
+
std::string getAnchorMarkup(const std::string&, const std::string& = "");
std::string getLinkMarkup(const std::string&, const std::string& = "", const std::string& = "", const std::string& = "");
std::string getImageMarkup(const std::string&, const std::string& = "");
std::string getNavMarkup(const std::string&, const std::string&);
-
+
void startEscapes();
void endEscapes();
-
+
std::string currentElement() const;
-
+
/**
* Wrap sections in these markers to prevent them from being confluence-escaped.
* The regular confluence-escaping process will remove these markers.
*/
const static std::string TEMP_ESCAPER_START; // wrap sections
const static std::string TEMP_ESCAPER_END; // wrap sections
-
+
/**
* Gets the start and end positions of all TEMP_ESCAPED sections of the given string.
*/
std::list<std::pair<unsigned int,unsigned int> > getMarkerLimits(const std::string&);
-
+
std::string removeMarkers(std::string);
-
+
private:
-
+
std::string escape(const ::std::string&) const;
-
+
std::stack<std::string> _elementStack;
-
+
bool _se;
bool _text;
-
+
bool _escape;
-
+
std::string _listMarkers;
std::string _commentListMarkers;
};
@@ -114,13 +114,13 @@ operator<<(ConfluenceOutput& o, const EndElement&)
class StartElement
{
public:
-
+
StartElement(const std::string&);
-
+
const std::string& getName() const;
-
+
private:
-
+
const std::string _name;
};
@@ -137,14 +137,14 @@ operator<<(ConfluenceOutput& o, const StartElement& e)
class Attribute
{
public:
-
+
Attribute(const ::std::string&, const ::std::string&);
-
+
const ::std::string& getName() const;
const ::std::string& getValue() const;
-
+
private:
-
+
const ::std::string _name;
const ::std::string _value;
};
diff --git a/cpp/src/slice2confluence/Main.cpp b/cpp/src/slice2confluence/Main.cpp
index 2d7b4d9219d..b812be5cd7a 100644
--- a/cpp/src/slice2confluence/Main.cpp
+++ b/cpp/src/slice2confluence/Main.cpp
@@ -24,7 +24,7 @@ using namespace IceUtil;
namespace
{
-IceUtil::Mutex* mutex = 0;
+IceUtil::Mutex* globalMutex = 0;
bool interrupted = false;
class Init
@@ -33,13 +33,13 @@ public:
Init()
{
- mutex = new IceUtil::Mutex;
+ globalMutex = new IceUtil::Mutex;
}
~Init()
{
- delete mutex;
- mutex = 0;
+ delete globalMutex;
+ globalMutex = 0;
}
};
@@ -72,7 +72,7 @@ splitCommas(string& str)
void
interruptedCallback(int signal)
{
- IceUtilInternal::MutexPtrLock<IceUtil::Mutex> sync(mutex);
+ IceUtilInternal::MutexPtrLock<IceUtil::Mutex> sync(globalMutex);
interrupted = true;
}
@@ -310,7 +310,7 @@ compile(int argc, char* argv[])
}
{
- IceUtilInternal::MutexPtrLock<IceUtil::Mutex> sync(mutex);
+ IceUtilInternal::MutexPtrLock<IceUtil::Mutex> sync(globalMutex);
if(interrupted)
{
@@ -352,7 +352,7 @@ compile(int argc, char* argv[])
p->destroy();
{
- IceUtilInternal::MutexPtrLock<IceUtil::Mutex> sync(mutex);
+ IceUtilInternal::MutexPtrLock<IceUtil::Mutex> sync(globalMutex);
if(interrupted)
{
diff --git a/cpp/src/slice2confluence/Makefile b/cpp/src/slice2confluence/Makefile
deleted file mode 100644
index 2bef9175f5d..00000000000
--- a/cpp/src/slice2confluence/Makefile
+++ /dev/null
@@ -1,31 +0,0 @@
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-top_srcdir = ../..
-
-NAME = $(bindir)/slice2confluence
-
-TARGETS = $(NAME)
-
-OBJS = ConfluenceOutput.o \
- Gen.o \
- Main.o
-
-RPATH_DIR = $(LOADER_PATH)/../$(libsubdir)
-
-include $(top_srcdir)/config/Make.rules
-
-CPPFLAGS := -I. $(CPPFLAGS)
-
-$(NAME): $(OBJS)
- rm -f $@
- $(CXX) $(LDFLAGS) $(LDEXEFLAGS) -o $@ $(OBJS) $(SLICE_LIBS) $(MCPP_RPATH_LINK)
-
-install:: all
- $(call installprogram,$(NAME),$(DESTDIR)$(install_bindir))