Compare commits
9 Commits
5bdd606fff
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 40718158ae | |||
| 727233624e | |||
| 948405bba4 | |||
| 5f7ae1233d | |||
| 6a3dea8614 | |||
| a93304418d | |||
| bb14979b8a | |||
| b64702260f | |||
| 5575a50a32 |
160
CMakeLists.txt
160
CMakeLists.txt
@@ -1,15 +1,51 @@
|
|||||||
cmake_minimum_required(VERSION 3.10)
|
cmake_minimum_required(VERSION 3.0.2)
|
||||||
project(xmlrpcpp)
|
project(robot_xmlrpcpp VERSION 1.0.0 LANGUAGES CXX)
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
if(DEFINED CATKIN_DEVEL_PREFIX OR DEFINED CATKIN_TOPLEVEL)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(BUILDING_WITH_CATKIN TRUE)
|
||||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
message(STATUS "Building robot_xmlrpcpp with Catkin")
|
||||||
|
|
||||||
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
else()
|
||||||
add_compile_options(-Wall -Wextra -Wpedantic -fPIC)
|
set(BUILDING_WITH_CATKIN FALSE)
|
||||||
|
message(STATUS "Building robot_xmlrpcpp with Standalone CMake")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library(xmlrpcpp
|
# C++ Standard - must be set before find_package
|
||||||
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||||
|
|
||||||
|
|
||||||
|
if (NOT BUILDING_WITH_CATKIN)
|
||||||
|
|
||||||
|
# Enable Position Independent Code
|
||||||
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||||
|
|
||||||
|
# Cấu hình RPATH để tránh cycle trong runtime search path
|
||||||
|
set(CMAKE_BUILD_RPATH_USE_ORIGIN TRUE)
|
||||||
|
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||||
|
set(CMAKE_BUILD_RPATH "${CMAKE_BINARY_DIR}")
|
||||||
|
|
||||||
|
else()
|
||||||
|
|
||||||
|
# ========================================================
|
||||||
|
# Catkin specific configuration
|
||||||
|
# ========================================================
|
||||||
|
find_package(catkin REQUIRED)
|
||||||
|
|
||||||
|
catkin_package(
|
||||||
|
INCLUDE_DIRS include
|
||||||
|
LIBRARIES ${PROJECT_NAME}
|
||||||
|
)
|
||||||
|
|
||||||
|
include_directories(
|
||||||
|
include
|
||||||
|
${catkin_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Libraries
|
||||||
|
add_library(${PROJECT_NAME} SHARED
|
||||||
src/XmlRpcClient.cpp
|
src/XmlRpcClient.cpp
|
||||||
src/XmlRpcDispatch.cpp
|
src/XmlRpcDispatch.cpp
|
||||||
src/XmlRpcServer.cpp
|
src/XmlRpcServer.cpp
|
||||||
@@ -21,33 +57,87 @@ add_library(xmlrpcpp
|
|||||||
src/XmlRpcValue.cpp
|
src/XmlRpcValue.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(xmlrpcpp
|
if(BUILDING_WITH_CATKIN)
|
||||||
PUBLIC
|
add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
|
||||||
$<INSTALL_INTERFACE:include/${PROJECT_NAME}>
|
|
||||||
)
|
|
||||||
|
|
||||||
# --- Cài đặt thư viện vào hệ thống khi chạy make install ---
|
target_include_directories(${PROJECT_NAME}
|
||||||
install(TARGETS xmlrpcpp
|
PUBLIC
|
||||||
EXPORT xmlrpcpp-targets
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||||
ARCHIVE DESTINATION lib # Thư viện tĩnh .a
|
$<INSTALL_INTERFACE:include>
|
||||||
LIBRARY DESTINATION lib # Thư viện động .so
|
)
|
||||||
RUNTIME DESTINATION bin # File thực thi (nếu có)
|
|
||||||
INCLUDES DESTINATION include # Cài đặt include
|
|
||||||
)
|
|
||||||
|
|
||||||
install(
|
target_link_libraries(${PROJECT_NAME}
|
||||||
DIRECTORY include/
|
PUBLIC ${catkin_LIBRARIES}
|
||||||
DESTINATION include/
|
)
|
||||||
)
|
|
||||||
|
|
||||||
# --- Xuất export set xmlrpcpp-targets thành file CMake module ---
|
else()
|
||||||
# --- Tạo file lib/cmake/xmlrpcpp/xmlrpcpp-targets.cmake ---
|
|
||||||
# --- File này chứa cấu hình giúp project khác có thể dùng ---
|
target_include_directories(${PROJECT_NAME}
|
||||||
# --- Find_package(xmlrpcpp REQUIRED) ---
|
PUBLIC
|
||||||
# --- Target_link_libraries(my_app PRIVATE xmlrpcpp::xmlrpcpp) ---
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||||
install(EXPORT xmlrpcpp-targets
|
$<INSTALL_INTERFACE:include>
|
||||||
FILE xmlrpcpp-targets.cmake
|
)
|
||||||
NAMESPACE xmlrpcpp::
|
|
||||||
DESTINATION lib/cmake/xmlrpcpp
|
# target_link_libraries(${PROJECT_NAME}
|
||||||
)
|
|
||||||
|
# )
|
||||||
|
|
||||||
|
set_target_properties(${PROJECT_NAME} PROPERTIES
|
||||||
|
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||||
|
BUILD_RPATH "${CMAKE_BINARY_DIR}"
|
||||||
|
INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib"
|
||||||
|
)
|
||||||
|
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Compiler flags
|
||||||
|
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||||
|
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Wpedantic -fPIC -Wno-unused-parameter)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(BUILDING_WITH_CATKIN)
|
||||||
|
## Mark libraries for installation
|
||||||
|
## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_libraries.html
|
||||||
|
install(TARGETS ${PROJECT_NAME}
|
||||||
|
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
|
||||||
|
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
|
||||||
|
RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}
|
||||||
|
)
|
||||||
|
|
||||||
|
## Mark cpp header files for installation
|
||||||
|
install(DIRECTORY include/${PROJECT_NAME}/
|
||||||
|
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
|
||||||
|
FILES_MATCHING PATTERN "*.h"
|
||||||
|
PATTERN ".svn" EXCLUDE
|
||||||
|
)
|
||||||
|
|
||||||
|
else()
|
||||||
|
|
||||||
|
install(TARGETS ${PROJECT_NAME}
|
||||||
|
EXPORT ${PROJECT_NAME}-targets
|
||||||
|
ARCHIVE DESTINATION lib
|
||||||
|
LIBRARY DESTINATION lib
|
||||||
|
RUNTIME DESTINATION bin
|
||||||
|
)
|
||||||
|
|
||||||
|
# Export targets
|
||||||
|
install(EXPORT ${PROJECT_NAME}-targets
|
||||||
|
FILE ${PROJECT_NAME}-targets.cmake
|
||||||
|
NAMESPACE ${PROJECT_NAME}::
|
||||||
|
DESTINATION lib/cmake/${PROJECT_NAME}
|
||||||
|
)
|
||||||
|
|
||||||
|
## Mark cpp header files for installation
|
||||||
|
install(DIRECTORY include/${PROJECT_NAME}/
|
||||||
|
DESTINATION include
|
||||||
|
FILES_MATCHING PATTERN "*.h"
|
||||||
|
PATTERN ".svn" EXCLUDE
|
||||||
|
)
|
||||||
|
|
||||||
|
# Print configuration info
|
||||||
|
message(STATUS "=================================")
|
||||||
|
message(STATUS "Project: ${PROJECT_NAME}")
|
||||||
|
message(STATUS "Version: ${PROJECT_VERSION}")
|
||||||
|
message(STATUS "C++ Standard: ${CMAKE_CXX_STANDARD}")
|
||||||
|
message(STATUS "=================================")
|
||||||
|
endif()
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#ifndef _XMLRPC_H_
|
#ifndef _ROBOT_XMLRPC_H_
|
||||||
#define _XMLRPC_H_
|
#define _ROBOT_XMLRPC_H_
|
||||||
//
|
//
|
||||||
// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley
|
// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley
|
||||||
// This library is free software; you can redistribute it and/or
|
// This library is free software; you can redistribute it and/or
|
||||||
@@ -32,8 +32,7 @@
|
|||||||
#include "XmlRpcValue.h"
|
#include "XmlRpcValue.h"
|
||||||
#include "XmlRpcUtil.h"
|
#include "XmlRpcUtil.h"
|
||||||
|
|
||||||
namespace robot {
|
namespace robot_xmlrpcpp {
|
||||||
namespace XmlRpc {
|
|
||||||
|
|
||||||
|
|
||||||
//! An interface allowing custom handling of error message reporting.
|
//! An interface allowing custom handling of error message reporting.
|
||||||
@@ -90,7 +89,6 @@ namespace XmlRpc {
|
|||||||
//! Version identifier
|
//! Version identifier
|
||||||
extern const char XMLRPC_VERSION[];
|
extern const char XMLRPC_VERSION[];
|
||||||
|
|
||||||
} // namespace XmlRpc
|
} // namespace robot_xmlrpcpp
|
||||||
} // namespace robot
|
|
||||||
|
|
||||||
#endif // _XMLRPC_H_
|
#endif // _ROBOT_XMLRPC_H_
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
|
#ifndef _ROBOT_XMLRPCCLIENT_H_
|
||||||
#ifndef _XMLRPCCLIENT_H_
|
#define _ROBOT_XMLRPCCLIENT_H_
|
||||||
#define _XMLRPCCLIENT_H_
|
|
||||||
//
|
//
|
||||||
// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley
|
// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley
|
||||||
//
|
//
|
||||||
@@ -13,11 +12,10 @@
|
|||||||
# include <string>
|
# include <string>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "xmlrpcpp/XmlRpcDispatch.h"
|
#include "robot_xmlrpcpp/XmlRpcDispatch.h"
|
||||||
#include "xmlrpcpp/XmlRpcSource.h"
|
#include "robot_xmlrpcpp/XmlRpcSource.h"
|
||||||
|
|
||||||
namespace robot {
|
namespace robot_xmlrpcpp {
|
||||||
namespace XmlRpc {
|
|
||||||
|
|
||||||
// Arguments and results are represented by XmlRpcValues
|
// Arguments and results are represented by XmlRpcValues
|
||||||
class XmlRpcValue;
|
class XmlRpcValue;
|
||||||
@@ -124,7 +122,6 @@ namespace XmlRpc {
|
|||||||
|
|
||||||
}; // class XmlRpcClient
|
}; // class XmlRpcClient
|
||||||
|
|
||||||
} // namespace XmlRpc
|
} // namespace robot_xmlrpcpp
|
||||||
} // namespace robot
|
|
||||||
|
|
||||||
#endif // _XMLRPCCLIENT_H_
|
#endif // _ROBOT_XMLRPCCLIENT_H_
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
|
#ifndef _ROBOT_XMLRPCDISPATCH_H_
|
||||||
|
#define _ROBOT_XMLRPCDISPATCH_H_
|
||||||
|
|
||||||
#ifndef _XMLRPCDISPATCH_H_
|
|
||||||
#define _XMLRPCDISPATCH_H_
|
|
||||||
//
|
|
||||||
// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley
|
// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley
|
||||||
//
|
//
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
@@ -12,8 +11,7 @@
|
|||||||
# include <list>
|
# include <list>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace robot {
|
namespace robot_xmlrpcpp {
|
||||||
namespace XmlRpc {
|
|
||||||
|
|
||||||
// An RPC source represents a file descriptor to monitor
|
// An RPC source represents a file descriptor to monitor
|
||||||
class XmlRpcSource;
|
class XmlRpcSource;
|
||||||
@@ -84,7 +82,6 @@ namespace XmlRpc {
|
|||||||
bool _inWork;
|
bool _inWork;
|
||||||
|
|
||||||
};
|
};
|
||||||
} // namespace XmlRpc
|
} // namespace robot_xmlrpcpp
|
||||||
} // namespace robot
|
|
||||||
|
|
||||||
#endif // _XMLRPCDISPATCH_H_
|
#endif // _ROBOT_XMLRPCDISPATCH_H_
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
|
#ifndef _ROBOT_XMLRPCEXCEPTION_H_
|
||||||
|
#define _ROBOT_XMLRPCEXCEPTION_H_
|
||||||
|
|
||||||
#ifndef _XMLRPCEXCEPTION_H_
|
|
||||||
#define _XMLRPCEXCEPTION_H_
|
|
||||||
//
|
|
||||||
// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley
|
// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley
|
||||||
//
|
//
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
@@ -13,8 +12,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
namespace robot {
|
namespace robot_xmlrpcpp {
|
||||||
namespace XmlRpc {
|
|
||||||
|
|
||||||
//! A class representing an error.
|
//! A class representing an error.
|
||||||
//! If server methods throw this exception, a fault response is returned
|
//! If server methods throw this exception, a fault response is returned
|
||||||
@@ -38,7 +36,6 @@ namespace XmlRpc {
|
|||||||
int _code;
|
int _code;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace XmlRpc
|
} // namespace robot_xmlrpcpp
|
||||||
} // namespace robot
|
|
||||||
|
|
||||||
#endif // _XMLRPCEXCEPTION_H_
|
#endif // _ROBOT_XMLRPCEXCEPTION_H_
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
|
#ifndef _ROBOT_XMLRPCSERVER_H_
|
||||||
|
#define _ROBOT_XMLRPCSERVER_H_
|
||||||
|
|
||||||
#ifndef _XMLRPCSERVER_H_
|
|
||||||
#define _XMLRPCSERVER_H_
|
|
||||||
//
|
|
||||||
// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley
|
// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley
|
||||||
//
|
//
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
@@ -13,11 +12,10 @@
|
|||||||
# include <string>
|
# include <string>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "xmlrpcpp/XmlRpcDispatch.h"
|
#include "robot_xmlrpcpp/XmlRpcDispatch.h"
|
||||||
#include "xmlrpcpp/XmlRpcSource.h"
|
#include "robot_xmlrpcpp/XmlRpcSource.h"
|
||||||
|
|
||||||
namespace robot {
|
namespace robot_xmlrpcpp {
|
||||||
namespace XmlRpc {
|
|
||||||
|
|
||||||
|
|
||||||
// An abstract class supporting XML RPC methods
|
// An abstract class supporting XML RPC methods
|
||||||
@@ -100,7 +98,6 @@ namespace XmlRpc {
|
|||||||
XmlRpcServerMethod* _methodHelp;
|
XmlRpcServerMethod* _methodHelp;
|
||||||
|
|
||||||
};
|
};
|
||||||
} // namespace XmlRpc
|
} // namespace robot_xmlrpcpp
|
||||||
} // namespace robot
|
|
||||||
|
|
||||||
#endif //_XMLRPCSERVER_H_
|
#endif //_ROBOT_XMLRPCSERVER_H_
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
#ifndef _XMLRPCSERVERCONNECTION_H_
|
#ifndef _ROBOT_XMLRPCSERVERCONNECTION_H_
|
||||||
#define _XMLRPCSERVERCONNECTION_H_
|
#define _ROBOT_XMLRPCSERVERCONNECTION_H_
|
||||||
//
|
//
|
||||||
// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley
|
// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley
|
||||||
//
|
//
|
||||||
@@ -11,11 +11,10 @@
|
|||||||
# include <string>
|
# include <string>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "xmlrpcpp/XmlRpcValue.h"
|
#include "robot_xmlrpcpp/XmlRpcValue.h"
|
||||||
#include "xmlrpcpp/XmlRpcSource.h"
|
#include "robot_xmlrpcpp/XmlRpcSource.h"
|
||||||
|
|
||||||
namespace robot {
|
namespace robot_xmlrpcpp {
|
||||||
namespace XmlRpc {
|
|
||||||
|
|
||||||
|
|
||||||
// The server waits for client connections and provides methods
|
// The server waits for client connections and provides methods
|
||||||
@@ -98,7 +97,6 @@ namespace XmlRpc {
|
|||||||
// Whether to keep the current client connection open for further requests
|
// Whether to keep the current client connection open for further requests
|
||||||
bool _keepAlive;
|
bool _keepAlive;
|
||||||
};
|
};
|
||||||
} // namespace XmlRpc
|
} // namespace robot_xmlrpcpp
|
||||||
} // namespace robot
|
|
||||||
|
|
||||||
#endif // _XMLRPCSERVERCONNECTION_H_
|
#endif // _ROBOT_XMLRPCSERVERCONNECTION_H_
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
|
#ifndef _ROBOT_XMLRPCSERVERMETHOD_H_
|
||||||
#ifndef _XMLRPCSERVERMETHOD_H_
|
|
||||||
#define _XMLRPCSERVERMETHOD_H_
|
#define _XMLRPCSERVERMETHOD_H_
|
||||||
//
|
#define _ROBOT_XMLRPCSERVERMETHOD_H_
|
||||||
// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley
|
// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley
|
||||||
//
|
//
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
@@ -12,8 +11,7 @@
|
|||||||
# include <string>
|
# include <string>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace robot {
|
namespace robot_xmlrpcpp {
|
||||||
namespace XmlRpc {
|
|
||||||
|
|
||||||
// Representation of a parameter or result value
|
// Representation of a parameter or result value
|
||||||
class XmlRpcValue;
|
class XmlRpcValue;
|
||||||
@@ -43,7 +41,6 @@ namespace XmlRpc {
|
|||||||
std::string _name;
|
std::string _name;
|
||||||
XmlRpcServer* _server;
|
XmlRpcServer* _server;
|
||||||
};
|
};
|
||||||
} // namespace XmlRpc
|
} // namespace robot_xmlrpcpp
|
||||||
} // namespace robot
|
|
||||||
|
|
||||||
#endif // _XMLRPCSERVERMETHOD_H_
|
#endif // _ROBOT_XMLRPCSERVERMETHOD_H_
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
#ifndef _XMLRPCSOCKET_H_
|
#ifndef _ROBOT_XMLRPCSOCKET_H_
|
||||||
#define _XMLRPCSOCKET_H_
|
#define _ROBOT_XMLRPCSOCKET_H_
|
||||||
//
|
//
|
||||||
// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley
|
// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley
|
||||||
//
|
//
|
||||||
@@ -11,8 +11,7 @@
|
|||||||
# include <string>
|
# include <string>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace robot {
|
namespace robot_xmlrpcpp {
|
||||||
namespace XmlRpc {
|
|
||||||
|
|
||||||
//! A platform-independent socket API.
|
//! A platform-independent socket API.
|
||||||
class XmlRpcSocket {
|
class XmlRpcSocket {
|
||||||
@@ -65,7 +64,6 @@ namespace XmlRpc {
|
|||||||
static std::string getErrorMsg(int error);
|
static std::string getErrorMsg(int error);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace XmlRpc
|
} // namespace robot_xmlrpcpp
|
||||||
} // namespace robot
|
|
||||||
|
|
||||||
#endif
|
#endif // _ROBOT_XMLRPCSOCKET_H_
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
|
#ifndef _ROBOT_XMLRPCSOURCE_H_
|
||||||
#ifndef _XMLRPCSOURCE_H_
|
#define _ROBOT_XMLRPCSOURCE_H_
|
||||||
#define _XMLRPCSOURCE_H_
|
|
||||||
//
|
//
|
||||||
// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley
|
// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley
|
||||||
//
|
//
|
||||||
@@ -8,8 +7,7 @@
|
|||||||
# pragma warning(disable:4786) // identifier was truncated in debug info
|
# pragma warning(disable:4786) // identifier was truncated in debug info
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace robot {
|
namespace robot_xmlrpcpp {
|
||||||
namespace XmlRpc {
|
|
||||||
|
|
||||||
//! An RPC source represents a file descriptor to monitor
|
//! An RPC source represents a file descriptor to monitor
|
||||||
class XmlRpcSource {
|
class XmlRpcSource {
|
||||||
@@ -51,7 +49,6 @@ namespace XmlRpc {
|
|||||||
// In the client, keep connections open if you intend to make multiple calls.
|
// In the client, keep connections open if you intend to make multiple calls.
|
||||||
bool _keepOpen;
|
bool _keepOpen;
|
||||||
};
|
};
|
||||||
} // namespace XmlRpc
|
} // namespace robot_xmlrpcpp
|
||||||
} // namespace robot
|
|
||||||
|
|
||||||
#endif //_XMLRPCSOURCE_H_
|
#endif //_ROBOT_XMLRPCSOURCE_H_
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
#ifndef _XMLRPCUTIL_H_
|
#ifndef _ROBOT_XMLRPCUTIL_H_
|
||||||
#define _XMLRPCUTIL_H_
|
#define _ROBOT_XMLRPCUTIL_H_
|
||||||
//
|
//
|
||||||
// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley
|
// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley
|
||||||
//
|
//
|
||||||
@@ -21,8 +21,7 @@
|
|||||||
# define strncasecmp strnicmp
|
# define strncasecmp strnicmp
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace robot {
|
namespace robot_xmlrpcpp {
|
||||||
namespace XmlRpc {
|
|
||||||
|
|
||||||
//! Utilities for XML parsing, encoding, and decoding and message handlers.
|
//! Utilities for XML parsing, encoding, and decoding and message handlers.
|
||||||
class XmlRpcUtil {
|
class XmlRpcUtil {
|
||||||
@@ -57,7 +56,6 @@ namespace XmlRpc {
|
|||||||
static void error(const char* fmt, ...);
|
static void error(const char* fmt, ...);
|
||||||
|
|
||||||
};
|
};
|
||||||
} // namespace XmlRpc
|
} // namespace robot_xmlrpcpp
|
||||||
} // namespace robot
|
|
||||||
|
|
||||||
#endif // _XMLRPCUTIL_H_
|
#endif // _XMLRPCUTIL_H_
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
|
#ifndef _ROBOT_XMLRPCVALUE_H_
|
||||||
#ifndef _XMLRPCVALUE_H_
|
#define _ROBOT_XMLRPCVALUE_H_
|
||||||
#define _XMLRPCVALUE_H_
|
|
||||||
//
|
//
|
||||||
// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley
|
// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley
|
||||||
//
|
//
|
||||||
@@ -15,8 +14,7 @@
|
|||||||
# include <time.h>
|
# include <time.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace robot {
|
namespace robot_xmlrpcpp {
|
||||||
namespace XmlRpc {
|
|
||||||
|
|
||||||
//! RPC method arguments and results are represented by Values
|
//! RPC method arguments and results are represented by Values
|
||||||
// should probably refcount them...
|
// should probably refcount them...
|
||||||
@@ -114,6 +112,9 @@ namespace XmlRpc {
|
|||||||
//! Check for the existence of a struct member by name.
|
//! Check for the existence of a struct member by name.
|
||||||
bool hasMember(const std::string& name) const;
|
bool hasMember(const std::string& name) const;
|
||||||
|
|
||||||
|
//! If this value is a struct, returns pointer to its members; otherwise nullptr.
|
||||||
|
const ValueStruct *getStructMembers() const;
|
||||||
|
|
||||||
//! Decode xml. Destroys any existing value.
|
//! Decode xml. Destroys any existing value.
|
||||||
bool fromXml(std::string const& valueXml, int* offset);
|
bool fromXml(std::string const& valueXml, int* offset);
|
||||||
|
|
||||||
@@ -181,11 +182,9 @@ namespace XmlRpc {
|
|||||||
} _value;
|
} _value;
|
||||||
|
|
||||||
};
|
};
|
||||||
} // namespace XmlRpc
|
} // namespace robot_xmlrpcpp
|
||||||
} // namespace robot
|
|
||||||
|
|
||||||
|
|
||||||
std::ostream& operator<<(std::ostream& os, robot::XmlRpc::XmlRpcValue& v);
|
std::ostream& operator<<(std::ostream& os, robot_xmlrpcpp::XmlRpcValue& v);
|
||||||
|
|
||||||
|
#endif // _ROBOT_XMLRPCVALUE_H_
|
||||||
#endif // _XMLRPCVALUE_H_
|
|
||||||
@@ -6,8 +6,8 @@
|
|||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
|
||||||
#if !defined(__BASE64_H_INCLUDED__)
|
#if !defined(__ROBOT_BASE64_H_INCLUDED__)
|
||||||
#define __BASE64_H_INCLUDED__ 1
|
#define __ROBOT_BASE64_H_INCLUDED__ 1
|
||||||
|
|
||||||
#ifndef MAKEDEPEND
|
#ifndef MAKEDEPEND
|
||||||
# include <iterator>
|
# include <iterator>
|
||||||
12
package.xml
12
package.xml
@@ -1,9 +1,9 @@
|
|||||||
<package>
|
<package>
|
||||||
<name>xmlrpcpp</name>
|
<name>robot_xmlrpcpp</name>
|
||||||
<version>0.7.10</version>
|
<version>0.7.10</version>
|
||||||
<description>
|
<description>
|
||||||
xmlrpcpp is the second generation of the transform library, which lets
|
robot_xmlrpcpp is the second generation of the transform library, which lets
|
||||||
the user keep track of multiple coordinate frames over time. xmlrpcpp
|
the user keep track of multiple coordinate frames over time. robot_xmlrpcpp
|
||||||
maintains the relationship between coordinate frames in a tree
|
maintains the relationship between coordinate frames in a tree
|
||||||
structure buffered in time, and lets the user transform points,
|
structure buffered in time, and lets the user transform points,
|
||||||
vectors, etc between any two coordinate frames at any desired
|
vectors, etc between any two coordinate frames at any desired
|
||||||
@@ -15,12 +15,8 @@
|
|||||||
<maintainer email="tfoote@osrfoundation.org">Tully Foote</maintainer>
|
<maintainer email="tfoote@osrfoundation.org">Tully Foote</maintainer>
|
||||||
<license>BSD</license>
|
<license>BSD</license>
|
||||||
|
|
||||||
<url type="website">http://www.ros.org/wiki/xmlrpcpp</url>
|
<url type="website">http://www.ros.org/wiki/robot_xmlrpcpp</url>
|
||||||
|
|
||||||
<buildtool_depend version_gte="0.5.68">catkin</buildtool_depend>
|
<buildtool_depend version_gte="0.5.68">catkin</buildtool_depend>
|
||||||
|
|
||||||
<build_depend>libconsole-bridge-dev</build_depend>
|
|
||||||
|
|
||||||
<run_depend>libconsole-bridge-dev</run_depend>
|
|
||||||
|
|
||||||
</package>
|
</package>
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
#include "xmlrpcpp/XmlRpcClient.h"
|
#include "robot_xmlrpcpp/XmlRpcClient.h"
|
||||||
|
|
||||||
#include "xmlrpcpp/XmlRpcSocket.h"
|
#include "robot_xmlrpcpp/XmlRpcSocket.h"
|
||||||
#include "xmlrpcpp/XmlRpc.h"
|
#include "robot_xmlrpcpp/XmlRpc.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
using namespace robot::XmlRpc;
|
using namespace robot_xmlrpcpp;
|
||||||
|
|
||||||
// Static data
|
// Static data
|
||||||
const char XmlRpcClient::REQUEST_BEGIN[] =
|
const char XmlRpcClient::REQUEST_BEGIN[] =
|
||||||
@@ -252,7 +252,7 @@ XmlRpcClient::generateHeader(std::string const& body)
|
|||||||
header += buff;
|
header += buff;
|
||||||
header += "Content-Type: text/xml\r\nContent-length: ";
|
header += "Content-Type: text/xml\r\nContent-length: ";
|
||||||
|
|
||||||
sprintf(buff,"%d\r\n\r\n", body.size());
|
sprintf(buff,"%d\r\n\r\n", (int)body.size());
|
||||||
|
|
||||||
return header + buff;
|
return header + buff;
|
||||||
}
|
}
|
||||||
@@ -397,7 +397,7 @@ XmlRpcClient::parseResponse(XmlRpcValue& result)
|
|||||||
// Expect either <params><param>... or <fault>...
|
// Expect either <params><param>... or <fault>...
|
||||||
if ((XmlRpcUtil::nextTagIs(PARAMS_TAG,_response,&offset) &&
|
if ((XmlRpcUtil::nextTagIs(PARAMS_TAG,_response,&offset) &&
|
||||||
XmlRpcUtil::nextTagIs(PARAM_TAG,_response,&offset)) ||
|
XmlRpcUtil::nextTagIs(PARAM_TAG,_response,&offset)) ||
|
||||||
XmlRpcUtil::nextTagIs(FAULT_TAG,_response,&offset) && (_isFault = true))
|
(XmlRpcUtil::nextTagIs(FAULT_TAG,_response,&offset) && (_isFault = true)))
|
||||||
{
|
{
|
||||||
if ( ! result.fromXml(_response, &offset)) {
|
if ( ! result.fromXml(_response, &offset)) {
|
||||||
XmlRpcUtil::error("Error in XmlRpcClient::parseResponse: Invalid response value. Response:\n%s", _response.c_str());
|
XmlRpcUtil::error("Error in XmlRpcClient::parseResponse: Invalid response value. Response:\n%s", _response.c_str());
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
#include "xmlrpcpp/XmlRpcDispatch.h"
|
#include "robot_xmlrpcpp/XmlRpcDispatch.h"
|
||||||
#include "xmlrpcpp/XmlRpcSource.h"
|
#include "robot_xmlrpcpp/XmlRpcSource.h"
|
||||||
#include "xmlrpcpp/XmlRpcUtil.h"
|
#include "robot_xmlrpcpp/XmlRpcUtil.h"
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <sys/timeb.h>
|
#include <sys/timeb.h>
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
#endif // _WINDOWS
|
#endif // _WINDOWS
|
||||||
|
|
||||||
|
|
||||||
using namespace robot::XmlRpc;
|
using namespace robot_xmlrpcpp;
|
||||||
|
|
||||||
|
|
||||||
XmlRpcDispatch::XmlRpcDispatch()
|
XmlRpcDispatch::XmlRpcDispatch()
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
|
|
||||||
#include "xmlrpcpp/XmlRpcServer.h"
|
#include "robot_xmlrpcpp/XmlRpcServer.h"
|
||||||
#include "xmlrpcpp/XmlRpcServerConnection.h"
|
#include "robot_xmlrpcpp/XmlRpcServerConnection.h"
|
||||||
#include "xmlrpcpp/XmlRpcServerMethod.h"
|
#include "robot_xmlrpcpp/XmlRpcServerMethod.h"
|
||||||
#include "xmlrpcpp/XmlRpcSocket.h"
|
#include "robot_xmlrpcpp/XmlRpcSocket.h"
|
||||||
#include "xmlrpcpp/XmlRpcUtil.h"
|
#include "robot_xmlrpcpp/XmlRpcUtil.h"
|
||||||
#include "xmlrpcpp/XmlRpcException.h"
|
#include "robot_xmlrpcpp/XmlRpcException.h"
|
||||||
|
|
||||||
|
|
||||||
using namespace robot::XmlRpc;
|
using namespace robot_xmlrpcpp;
|
||||||
|
|
||||||
|
|
||||||
XmlRpcServer::XmlRpcServer()
|
XmlRpcServer::XmlRpcServer()
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
#include "xmlrpcpp/XmlRpcServerConnection.h"
|
#include "robot_xmlrpcpp/XmlRpcServerConnection.h"
|
||||||
|
|
||||||
#include "xmlrpcpp/XmlRpcSocket.h"
|
#include "robot_xmlrpcpp/XmlRpcSocket.h"
|
||||||
#include "xmlrpcpp/XmlRpc.h"
|
#include "robot_xmlrpcpp/XmlRpc.h"
|
||||||
#ifndef MAKEDEPEND
|
#ifndef MAKEDEPEND
|
||||||
# include <stdio.h>
|
# include <stdio.h>
|
||||||
# include <stdlib.h>
|
# include <stdlib.h>
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using namespace robot::XmlRpc;
|
using namespace robot_xmlrpcpp;
|
||||||
|
|
||||||
// Static data
|
// Static data
|
||||||
const char XmlRpcServerConnection::METHODNAME_TAG[] = "<methodName>";
|
const char XmlRpcServerConnection::METHODNAME_TAG[] = "<methodName>";
|
||||||
@@ -348,7 +348,7 @@ XmlRpcServerConnection::generateHeader(std::string const& body)
|
|||||||
"Content-length: ";
|
"Content-length: ";
|
||||||
|
|
||||||
char buffLen[40];
|
char buffLen[40];
|
||||||
sprintf(buffLen,"%d\r\n\r\n", body.size());
|
sprintf(buffLen,"%d\r\n\r\n", (int)body.size());
|
||||||
|
|
||||||
return header + buffLen;
|
return header + buffLen;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
|
|
||||||
#include "xmlrpcpp/XmlRpcServerMethod.h"
|
#include "robot_xmlrpcpp/XmlRpcServerMethod.h"
|
||||||
#include "xmlrpcpp/XmlRpcServer.h"
|
#include "robot_xmlrpcpp/XmlRpcServer.h"
|
||||||
|
|
||||||
namespace robot {
|
namespace robot_xmlrpcpp {
|
||||||
namespace XmlRpc {
|
|
||||||
|
|
||||||
|
|
||||||
XmlRpcServerMethod::XmlRpcServerMethod(std::string const& name, XmlRpcServer* server)
|
XmlRpcServerMethod::XmlRpcServerMethod(std::string const& name, XmlRpcServer* server)
|
||||||
@@ -19,5 +18,4 @@ namespace XmlRpc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace XmlRpc
|
} // namespace robot_xmlrpcpp
|
||||||
} // namespace robot
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
#include "xmlrpcpp/XmlRpcSocket.h"
|
#include "robot_xmlrpcpp/XmlRpcSocket.h"
|
||||||
#include "xmlrpcpp/XmlRpcUtil.h"
|
#include "robot_xmlrpcpp/XmlRpcUtil.h"
|
||||||
|
|
||||||
#ifndef MAKEDEPEND
|
#ifndef MAKEDEPEND
|
||||||
|
|
||||||
@@ -30,7 +30,7 @@ extern "C" {
|
|||||||
#endif // MAKEDEPEND
|
#endif // MAKEDEPEND
|
||||||
|
|
||||||
|
|
||||||
using namespace robot::XmlRpc;
|
using namespace robot_xmlrpcpp;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
|
|
||||||
#include "xmlrpcpp/XmlRpcSource.h"
|
#include "robot_xmlrpcpp/XmlRpcSource.h"
|
||||||
#include "xmlrpcpp/XmlRpcSocket.h"
|
#include "robot_xmlrpcpp/XmlRpcSocket.h"
|
||||||
#include "xmlrpcpp/XmlRpcUtil.h"
|
#include "robot_xmlrpcpp/XmlRpcUtil.h"
|
||||||
|
|
||||||
namespace robot {
|
namespace robot_xmlrpcpp {
|
||||||
namespace XmlRpc {
|
|
||||||
|
|
||||||
|
|
||||||
XmlRpcSource::XmlRpcSource(int fd /*= -1*/, bool deleteOnClose /*= false*/)
|
XmlRpcSource::XmlRpcSource(int fd /*= -1*/, bool deleteOnClose /*= false*/)
|
||||||
@@ -33,5 +32,4 @@ namespace XmlRpc {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace XmlRpc
|
} // namespace robot_xmlrpcpp
|
||||||
} // namespace robot
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
#include "xmlrpcpp/XmlRpcUtil.h"
|
#include "robot_xmlrpcpp/XmlRpcUtil.h"
|
||||||
|
|
||||||
#ifndef MAKEDEPEND
|
#ifndef MAKEDEPEND
|
||||||
# include <ctype.h>
|
# include <ctype.h>
|
||||||
@@ -9,9 +9,9 @@
|
|||||||
# include <string.h>
|
# include <string.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "xmlrpcpp/XmlRpc.h"
|
#include "robot_xmlrpcpp/XmlRpc.h"
|
||||||
|
|
||||||
using namespace robot::XmlRpc;
|
using namespace robot_xmlrpcpp;
|
||||||
|
|
||||||
|
|
||||||
//#define USE_WINDOWS_DEBUG // To make the error and log messages go to VC++ debug output
|
//#define USE_WINDOWS_DEBUG // To make the error and log messages go to VC++ debug output
|
||||||
@@ -21,7 +21,7 @@ using namespace robot::XmlRpc;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Version id
|
// Version id
|
||||||
const char robot::XmlRpc::XMLRPC_VERSION[] = "XMLRPC++ 0.7";
|
const char robot_xmlrpcpp::XMLRPC_VERSION[] = "XMLRPC++ 0.7";
|
||||||
|
|
||||||
// Default log verbosity: 0 for no messages through 5 (writes everything)
|
// Default log verbosity: 0 for no messages through 5 (writes everything)
|
||||||
int XmlRpcLogHandler::_verbosity = 0;
|
int XmlRpcLogHandler::_verbosity = 0;
|
||||||
@@ -63,8 +63,8 @@ XmlRpcErrorHandler* XmlRpcErrorHandler::_errorHandler = &defaultErrorHandler;
|
|||||||
|
|
||||||
|
|
||||||
// Easy API for log verbosity
|
// Easy API for log verbosity
|
||||||
int robot::XmlRpc::getVerbosity() { return XmlRpcLogHandler::getVerbosity(); }
|
int robot_xmlrpcpp::getVerbosity() { return XmlRpcLogHandler::getVerbosity(); }
|
||||||
void robot::XmlRpc::setVerbosity(int level) { XmlRpcLogHandler::setVerbosity(level); }
|
void robot_xmlrpcpp::setVerbosity(int level) { XmlRpcLogHandler::setVerbosity(level); }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
#include "xmlrpcpp/XmlRpcValue.h"
|
#include "robot_xmlrpcpp/XmlRpcValue.h"
|
||||||
#include "xmlrpcpp/XmlRpcException.h"
|
#include "robot_xmlrpcpp/XmlRpcException.h"
|
||||||
#include "xmlrpcpp/XmlRpcUtil.h"
|
#include "robot_xmlrpcpp/XmlRpcUtil.h"
|
||||||
#include "xmlrpcpp/base64.h"
|
#include "robot_xmlrpcpp/base64.h"
|
||||||
|
|
||||||
#ifndef MAKEDEPEND
|
#ifndef MAKEDEPEND
|
||||||
# include <iostream>
|
# include <iostream>
|
||||||
@@ -11,8 +11,7 @@
|
|||||||
# include <stdio.h>
|
# include <stdio.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace robot {
|
namespace robot_xmlrpcpp {
|
||||||
namespace XmlRpc {
|
|
||||||
|
|
||||||
|
|
||||||
static const char VALUE_TAG[] = "<value>";
|
static const char VALUE_TAG[] = "<value>";
|
||||||
@@ -210,6 +209,13 @@ namespace XmlRpc {
|
|||||||
return _type == TypeStruct && _value.asStruct->find(name) != _value.asStruct->end();
|
return _type == TypeStruct && _value.asStruct->find(name) != _value.asStruct->end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const XmlRpcValue::ValueStruct *XmlRpcValue::getStructMembers() const
|
||||||
|
{
|
||||||
|
if (_type != TypeStruct)
|
||||||
|
return nullptr;
|
||||||
|
return _value.asStruct;
|
||||||
|
}
|
||||||
|
|
||||||
// Set the value from xml. The chars at *offset into valueXml
|
// Set the value from xml. The chars at *offset into valueXml
|
||||||
// should be the start of a <value> tag. Destroys any existing value.
|
// should be the start of a <value> tag. Destroys any existing value.
|
||||||
bool XmlRpcValue::fromXml(std::string const& valueXml, int* offset)
|
bool XmlRpcValue::fromXml(std::string const& valueXml, int* offset)
|
||||||
@@ -598,12 +604,11 @@ namespace XmlRpc {
|
|||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace XmlRpc
|
} // namespace robot_xmlrpcpp
|
||||||
} // namespace robot
|
|
||||||
|
|
||||||
|
|
||||||
// ostream
|
// ostream
|
||||||
std::ostream& operator<<(std::ostream& os, robot::XmlRpc::XmlRpcValue& v)
|
std::ostream& operator<<(std::ostream& os, robot_xmlrpcpp::XmlRpcValue& v)
|
||||||
{
|
{
|
||||||
// If you want to output in xml format:
|
// If you want to output in xml format:
|
||||||
//return os << v.toXml();
|
//return os << v.toXml();
|
||||||
|
|||||||
Reference in New Issue
Block a user