From: Jaemin Ryu Date: Fri, 14 Dec 2018 01:37:25 +0000 (+0900) Subject: Add namespace alias X-Git-Tag: submit/tizen/20190219.012108~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0925b19dc71bfaba018a7ca5070de920ecbece08;p=platform%2Fcore%2Fsecurity%2Fklay.git Add namespace alias Change-Id: I54e8bc7783cd6a4fa35018e8657be3b02204be67 Signed-off-by: Jaemin Ryu --- diff --git a/include/klay/audit/audit-trail.h b/include/klay/audit/audit-trail.h index dcfd298..850699f 100644 --- a/include/klay/audit/audit-trail.h +++ b/include/klay/audit/audit-trail.h @@ -24,7 +24,7 @@ #include -namespace audit { +namespace klay { class KLAY_EXPORT AuditTrail { public: @@ -42,5 +42,8 @@ private: std::thread dispatcher; }; -} // namespace audit +} // namespace klay + +namespace audit = klay; + #endif //__AUDIT_TRAIL_H__ diff --git a/include/klay/audit/console-sink.h b/include/klay/audit/console-sink.h index a57db77..1afa741 100644 --- a/include/klay/audit/console-sink.h +++ b/include/klay/audit/console-sink.h @@ -21,12 +21,15 @@ #include "logsink.h" -namespace audit { +namespace klay { class KLAY_EXPORT ConsoleLogSink : public LogSink { public: void sink(const std::string& message) override; }; -} // namespace audit +} // namespace klay + +namespace audit = klay; + #endif //__AUDIT_CONSOLE_LOGSINK_H__ diff --git a/include/klay/audit/dlog-sink.h b/include/klay/audit/dlog-sink.h index 3313100..f0e17c8 100644 --- a/include/klay/audit/dlog-sink.h +++ b/include/klay/audit/dlog-sink.h @@ -21,7 +21,7 @@ #include "logsink.h" -namespace audit { +namespace klay { class KLAY_EXPORT DlogLogSink : public LogSink { public: @@ -32,5 +32,8 @@ private: std::string tag; }; -} // namespace audit +} // namespace klay + +namespace audit = klay; + #endif //__AUDIT_DLOG_LOGSINK_H__ diff --git a/include/klay/audit/logger-core.h b/include/klay/audit/logger-core.h index ae28d3e..85e5d78 100644 --- a/include/klay/audit/logger-core.h +++ b/include/klay/audit/logger-core.h @@ -23,7 +23,7 @@ #include #include -namespace audit { +namespace klay { class KLAY_EXPORT LoggerCore { public: @@ -46,5 +46,8 @@ private: ConsoleLogSink defaultSink; }; -} // namespace audit +} // namespace klay + +namespace audit = klay; + #endif //__AUDIT_LOGGER_CORE_H__ diff --git a/include/klay/audit/logger.h b/include/klay/audit/logger.h index 5282be5..b45a9ee 100644 --- a/include/klay/audit/logger.h +++ b/include/klay/audit/logger.h @@ -25,7 +25,7 @@ #include "logsink.h" -namespace audit { +namespace klay { enum class KLAY_EXPORT LogLevel : int { Silent, @@ -98,5 +98,8 @@ do { \ #define INFO(args...) GET_MACRO(args, INFO2, INFO1)(args) #define TRACE(args...) GET_MACRO(args, TRACE2, TRACE1)(args) -} // namespace audit +} // namespace klay + +namespace audit = klay; + #endif //__AUDIT_LOGGER_H__ diff --git a/include/klay/audit/logsink.h b/include/klay/audit/logsink.h index 83f1915..af5740c 100644 --- a/include/klay/audit/logsink.h +++ b/include/klay/audit/logsink.h @@ -21,7 +21,7 @@ #include -namespace audit { +namespace klay { class KLAY_EXPORT LogSink { public: @@ -30,5 +30,8 @@ public: virtual void sink(const std::string& message) = 0; }; -} // namespace audit +} // namespace klay + +namespace audit = klay; + #endif //__AUDIT_LOGSINK_H__ diff --git a/include/klay/audit/null-sink.h b/include/klay/audit/null-sink.h index 7429798..2e26159 100644 --- a/include/klay/audit/null-sink.h +++ b/include/klay/audit/null-sink.h @@ -21,12 +21,15 @@ #include "logsink.h" -namespace audit { +namespace klay { class KLAY_EXPORT NullLogSink : public LogSink { public: void sink(const std::string& message) override; }; -} // namespace audit +} // namespace klay + +namespace audit = klay; + #endif //__AUDIT_NULL_LOGSINK_H__ diff --git a/include/klay/auth/group.h b/include/klay/auth/group.h index 625862a..cd7abdf 100644 --- a/include/klay/auth/group.h +++ b/include/klay/auth/group.h @@ -28,7 +28,7 @@ #define INVALID_GID UINT_MAX #endif -namespace runtime { +namespace klay { class KLAY_EXPORT Group final { public: @@ -52,6 +52,8 @@ private: gid_t gid; }; -} // namespace runtime +} // namespace klay + +namespace runtime = klay; #endif //__RUNTIME_GROUP_H__ diff --git a/include/klay/auth/user.h b/include/klay/auth/user.h index a5130d9..d84f5a8 100644 --- a/include/klay/auth/user.h +++ b/include/klay/auth/user.h @@ -28,7 +28,7 @@ #define INVALID_UID UINT_MAX #endif -namespace runtime { +namespace klay { class KLAY_EXPORT User final { public: @@ -58,6 +58,8 @@ private: gid_t gid; }; -} // namespace runtime +} // namespace klay + +namespace runtime = klay; #endif //__RUNTIME_USER_H__ diff --git a/include/klay/cgroup.h b/include/klay/cgroup.h index 1b41d45..4900ef4 100644 --- a/include/klay/cgroup.h +++ b/include/klay/cgroup.h @@ -22,7 +22,7 @@ #include -namespace runtime { +namespace klay { class KLAY_EXPORT Cgroup final { public: @@ -44,6 +44,8 @@ public: static const std::string getPath(const std::string& subsystem, const pid_t pid); }; -} // namespace runtime +} // namespace klay + +namespace runtime = klay; #endif //!__RUNTIME_CGROUP_H__ diff --git a/include/klay/colorize.h b/include/klay/colorize.h index 84b0103..3c20702 100644 --- a/include/klay/colorize.h +++ b/include/klay/colorize.h @@ -17,7 +17,7 @@ #include -namespace console { +namespace klay { enum Code { BLACK = 31, @@ -44,4 +44,6 @@ private: Code code; }; -} // namespace console +} // namespace klay + +namespace console = klay; \ No newline at end of file diff --git a/include/klay/db/column.h b/include/klay/db/column.h index 2b033d4..acd0793 100644 --- a/include/klay/db/column.h +++ b/include/klay/db/column.h @@ -24,6 +24,7 @@ #include #include +namespace klay { namespace database { class KLAY_EXPORT Column { @@ -76,5 +77,8 @@ private: }; } // namespace database +} // namespace klay + +namespace database = klay::database; #endif //__DATABASE_COLUMN_H__ diff --git a/include/klay/db/connection.h b/include/klay/db/connection.h index a6569c2..9f533c1 100644 --- a/include/klay/db/connection.h +++ b/include/klay/db/connection.h @@ -23,6 +23,7 @@ #include +namespace klay { namespace database { class KLAY_EXPORT Connection { @@ -74,4 +75,8 @@ private: }; } // namespace database +} // namespace klay + +namespace database = klay::database; + #endif //__DATABASE_CONNECTION_H__ diff --git a/include/klay/db/statement.h b/include/klay/db/statement.h index 286de8b..1ae2cb9 100644 --- a/include/klay/db/statement.h +++ b/include/klay/db/statement.h @@ -24,6 +24,7 @@ #include +namespace klay { namespace database { class Column; @@ -82,5 +83,8 @@ private: }; } // namespace database +} // namespace klay + +namespace database = klay::database; #endif //__DATABASE_STATEMENT_H__ diff --git a/include/klay/dbus/connection.h b/include/klay/dbus/connection.h index 283d63d..1559b6d 100644 --- a/include/klay/dbus/connection.h +++ b/include/klay/dbus/connection.h @@ -26,6 +26,7 @@ #include #include +namespace klay { namespace dbus { class KLAY_EXPORT Connection { @@ -158,5 +159,8 @@ private: }; } // namespace dbus +} // namespace klay + +namespace dbus = klay::dbus; #endif //! __RUNTIME_DBUS_CONNECTION_H__ diff --git a/include/klay/dbus/error.h b/include/klay/dbus/error.h index a72cfaf..f89988a 100644 --- a/include/klay/dbus/error.h +++ b/include/klay/dbus/error.h @@ -21,6 +21,7 @@ #include +namespace klay { namespace dbus { class KLAY_EXPORT Error { @@ -37,5 +38,8 @@ private: }; } // namespace dbus +} // namespace klay + +namespace dbus = klay::dbus; #endif //!__RUNTIME_DBUS_ERROR_H__ diff --git a/include/klay/dbus/introspection.h b/include/klay/dbus/introspection.h index 775cb5d..3e4769f 100644 --- a/include/klay/dbus/introspection.h +++ b/include/klay/dbus/introspection.h @@ -25,6 +25,7 @@ #include +namespace klay { namespace dbus { using BusNode = GDBusNodeInfo*; @@ -85,5 +86,8 @@ private: }; } // namespace dbus +} // namespace klay + +namespace dbus = klay::dbus; #endif //! __RUNTIME_DBUS_INTROSPECTION_H__ diff --git a/include/klay/dbus/signal.h b/include/klay/dbus/signal.h index 9573b8b..70d82c6 100644 --- a/include/klay/dbus/signal.h +++ b/include/klay/dbus/signal.h @@ -24,6 +24,7 @@ #include #include +namespace klay { namespace dbus { namespace signal { @@ -86,5 +87,8 @@ void Sender::emit(const std::string &signalName, } // namespace signal } // namespace dbus +} // namespace klay + +namespace dbus = klay::dbus; #endif //! __RUNTIME_DBUS_SIGNAL_H__ diff --git a/include/klay/dbus/variant.h b/include/klay/dbus/variant.h index cd81660..90b3e53 100644 --- a/include/klay/dbus/variant.h +++ b/include/klay/dbus/variant.h @@ -23,6 +23,7 @@ #include +namespace klay { namespace dbus { class KLAY_EXPORT Variant { @@ -58,7 +59,9 @@ private: GVariantIter* iterator; }; - } // namespace dbus +} // namespace klay + +namespace dbus = klay::dbus; #endif //!__RUNTIME_DBUS_VARIANT_H__ diff --git a/include/klay/error.h b/include/klay/error.h index d9ec20d..e339789 100644 --- a/include/klay/error.h +++ b/include/klay/error.h @@ -17,11 +17,13 @@ #ifndef __RUNTIME_ERROR_H__ #define __RUNTIME_ERROR_H__ +#include + #include #include -namespace runtime { +namespace klay { class KLAY_EXPORT Error { public: @@ -33,5 +35,8 @@ public: KLAY_EXPORT std::string GetSystemErrorMessage(); KLAY_EXPORT std::string GetSystemErrorMessage(int errorCode); -} // namespace runtime +} // namespace klay + +namespace runtime = klay; + #endif //__RUNTIME_ERROR_H__ diff --git a/include/klay/eventfd.h b/include/klay/eventfd.h index e2560ee..ae0b302 100644 --- a/include/klay/eventfd.h +++ b/include/klay/eventfd.h @@ -21,7 +21,7 @@ #include -namespace runtime { +namespace klay { class KLAY_EXPORT EventFD { public: @@ -44,6 +44,8 @@ private: int fd; }; -} // namespace runtime +} // namespace klay + +namespace runtime = klay; #endif //__RUNTIME_EVENTFD_H__ diff --git a/include/klay/exception.h b/include/klay/exception.h index c91ea96..37db51d 100644 --- a/include/klay/exception.h +++ b/include/klay/exception.h @@ -22,7 +22,7 @@ #include -namespace runtime { +namespace klay { class KLAY_EXPORT Exception: public std::runtime_error { public: @@ -71,5 +71,8 @@ EXCEPTION_DEFINE(TimeoutException) EXCEPTION_DEFINE(NoPermissionException) EXCEPTION_DEFINE(OutOfMemoryException) EXCEPTION_DEFINE(IOException) -} // namespace runtime +} // namespace klay + +namespace runtime = klay; + #endif //__RUNTIME_EXCEPTION_H__ diff --git a/include/klay/file-descriptor.h b/include/klay/file-descriptor.h index 9991d7d..e9af197 100644 --- a/include/klay/file-descriptor.h +++ b/include/klay/file-descriptor.h @@ -19,7 +19,7 @@ #include -namespace runtime { +namespace klay { struct KLAY_EXPORT FileDescriptor { FileDescriptor(int fd = -1, bool autoclose = false) : @@ -46,6 +46,8 @@ private: bool autoClose; }; -} +} // namespace klay + +namespace runtime = klay; #endif //__RUNTIME_FILE_DESCRIPTOR_H__ diff --git a/include/klay/file-user.h b/include/klay/file-user.h index c57d9d0..021c5c4 100644 --- a/include/klay/file-user.h +++ b/include/klay/file-user.h @@ -22,7 +22,7 @@ #include -namespace runtime { +namespace klay { class KLAY_EXPORT FileUser final { public: @@ -36,6 +36,8 @@ public: static std::vector getList(const std::string &path, bool isMount = false); }; -} // namespace runtime +} // namespace klay + +namespace runtime = klay; #endif /* __FILE_USER_H__ */ diff --git a/include/klay/filesystem.h b/include/klay/filesystem.h index 68c23e6..3cc60c8 100644 --- a/include/klay/filesystem.h +++ b/include/klay/filesystem.h @@ -24,7 +24,7 @@ #include -namespace runtime { +namespace klay { class KLAY_EXPORT File { public: @@ -195,5 +195,8 @@ public: int Open(const std::string& path, int flags, mode_t mode); void Close(int fd); -} // namespace runtime +} // namespace klay + +namespace runtime = klay; + #endif //__RUNTIME_FILESYSTEM_H__ diff --git a/include/klay/latch.h b/include/klay/latch.h index 363871e..6ddf3fd 100644 --- a/include/klay/latch.h +++ b/include/klay/latch.h @@ -22,7 +22,7 @@ #include -namespace runtime { +namespace klay { class KLAY_EXPORT Latch { public: @@ -72,5 +72,8 @@ private: unsigned int count; }; -} // namespace runtime +} // namespace klay + +namespace runtime = klay; + #endif // __RUNTIME_LATCH_H__ diff --git a/include/klay/mainloop.h b/include/klay/mainloop.h index 662020f..2557828 100644 --- a/include/klay/mainloop.h +++ b/include/klay/mainloop.h @@ -30,7 +30,7 @@ #include "eventfd.h" -namespace runtime { +namespace klay { class KLAY_EXPORT Mainloop { public: @@ -58,6 +58,8 @@ private: void prepare(); }; -} // namespace runtime +} // namespace klay + +namespace runtime = klay; #endif //__RUNTIME_MAINLOOP_H__ diff --git a/include/klay/namespace.h b/include/klay/namespace.h index c8a52c9..b42f12c 100644 --- a/include/klay/namespace.h +++ b/include/klay/namespace.h @@ -21,7 +21,7 @@ #include -namespace runtime { +namespace klay { class KLAY_EXPORT Namespace final { public: @@ -31,6 +31,8 @@ public: static void attach(const pid_t pid); }; -} // namespace runtime +} // namespace klay + +namespace runtime = klay; #endif //!__RUNTIME_NAMESPACE_H__ diff --git a/include/klay/netlink/netlink.h b/include/klay/netlink/netlink.h index a69c4d6..217be3a 100644 --- a/include/klay/netlink/netlink.h +++ b/include/klay/netlink/netlink.h @@ -26,6 +26,7 @@ #define NETLINK_AUDIT 9 #endif +namespace klay { namespace netlink { class KLAY_EXPORT Netlink final { @@ -51,6 +52,9 @@ private: unsigned int sequence; }; -} // namespace runtime +} // namespace netlink +} // namespace klay + +namespace netlink = klay::netlink; #endif //!__RUNTIME_NETLINK_NETLINK_H__ diff --git a/include/klay/pam.h b/include/klay/pam.h index 93e1b05..0ce7145 100644 --- a/include/klay/pam.h +++ b/include/klay/pam.h @@ -24,7 +24,7 @@ #include #include -namespace runtime { +namespace klay { class PAM final { public: @@ -61,5 +61,8 @@ private: pam_handle_t* pamh; }; -} // namespace runtime +} // namespace klay + +namespace runtime = klay; + #endif // __RUNTIME_PAM_H__ diff --git a/include/klay/process.h b/include/klay/process.h index 87575ed..c1ff476 100644 --- a/include/klay/process.h +++ b/include/klay/process.h @@ -22,7 +22,7 @@ #include -namespace runtime { +namespace klay { class KLAY_EXPORT Process { public: @@ -52,5 +52,8 @@ private: std::vector args; }; -} // namespace runtime +} // namespace klay + +namespace runtime = klay; + #endif //__RUNTIME_PROCESS_H__ diff --git a/include/klay/rmi/callback-holder.h b/include/klay/rmi/callback-holder.h index 99d1cf8..164e91c 100644 --- a/include/klay/rmi/callback-holder.h +++ b/include/klay/rmi/callback-holder.h @@ -22,6 +22,7 @@ #include +namespace klay { namespace rmi { template @@ -71,4 +72,8 @@ struct CallbackHolder { }; } // namespace rmi +} // namespace klay + +namespace rmi = klay::rmi; + #endif //!__RMI_CALLBACK_HOLDER_H__ diff --git a/include/klay/rmi/client.h b/include/klay/rmi/client.h index 2af2d31..96e7716 100644 --- a/include/klay/rmi/client.h +++ b/include/klay/rmi/client.h @@ -28,6 +28,7 @@ #include #include +namespace klay { namespace rmi { template @@ -185,4 +186,8 @@ public: using Client = RemoteAccessClient; } // namespace rmi +} // namespace klay + +namespace rmi = klay::rmi; + #endif //__RMI_CLIENT_H__ diff --git a/include/klay/rmi/connection.h b/include/klay/rmi/connection.h index 4a8cd80..466a614 100644 --- a/include/klay/rmi/connection.h +++ b/include/klay/rmi/connection.h @@ -24,6 +24,7 @@ #include #include +namespace klay { namespace rmi { class KLAY_EXPORT Connection { @@ -58,4 +59,8 @@ private: }; } // namespace rmi +} // namespace klay + +namespace rmi = klay::rmi; + #endif //__RMI_CONNECTION_H__ diff --git a/include/klay/rmi/message-composer.h b/include/klay/rmi/message-composer.h index 41d366a..c941688 100644 --- a/include/klay/rmi/message-composer.h +++ b/include/klay/rmi/message-composer.h @@ -21,6 +21,7 @@ #include +namespace klay { namespace rmi { class KLAY_EXPORT MessageComposer { @@ -67,4 +68,8 @@ private: }; } // namespae rmi +} // namespae klay + +namespace rmi = klay::rmi; + #endif //__RMI_MESSAGE_COMPOSER_H__ diff --git a/include/klay/rmi/message.h b/include/klay/rmi/message.h index e8afdd7..f0e606f 100644 --- a/include/klay/rmi/message.h +++ b/include/klay/rmi/message.h @@ -27,6 +27,7 @@ #include #include +namespace klay { namespace rmi { class KLAY_EXPORT Message { @@ -238,4 +239,8 @@ template<> void Message::enclose(runtime::FileDescriptor&& fd); template<> void Message::disclose(runtime::FileDescriptor& fd); } // namespae rmi +} // namespae klay + +namespace rmi = klay::rmi; + #endif //__RMI_MESSAGE_H__ diff --git a/include/klay/rmi/method.h b/include/klay/rmi/method.h index aae4ccc..a27cf95 100644 --- a/include/klay/rmi/method.h +++ b/include/klay/rmi/method.h @@ -28,6 +28,7 @@ #include #include +namespace klay { namespace rmi { template @@ -67,4 +68,8 @@ RemoteMethod::~RemoteMethod() } } // namespace rmi +} // namespace klay + +namespace rmi = klay::rmi; + #endif //__RMI_REMOTEMETHOD_H__ diff --git a/include/klay/rmi/notification.h b/include/klay/rmi/notification.h index a48e108..b2bec9a 100644 --- a/include/klay/rmi/notification.h +++ b/include/klay/rmi/notification.h @@ -30,6 +30,7 @@ #include #include +namespace klay { namespace rmi { typedef std::pair SubscriptionId; @@ -71,4 +72,8 @@ void Notification::notify(Args&&... args) } } // namespae rmi +} // namespae klay + +namespace rmi = klay::rmi; + #endif //__RMI_NOTIFICATION_H__ diff --git a/include/klay/rmi/service.h b/include/klay/rmi/service.h index 013cab1..5fe2748 100644 --- a/include/klay/rmi/service.h +++ b/include/klay/rmi/service.h @@ -140,6 +140,7 @@ setMethodHandler \ setMethodHandler \ (P, STRINGIFY(TYPEOF(STRIP(M))), std::bind(&TYPEOF(STRIP(M)), T)) +namespace klay { namespace rmi { typedef std::function ConnectionCallback; @@ -276,5 +277,8 @@ void Service::notify(const std::string& name, Args&&... args) } } // namespace rmi +} // namespace klay + +namespace rmi = klay::rmi; #endif //__RMI_SERVICE_H__ diff --git a/include/klay/rmi/socket.h b/include/klay/rmi/socket.h index 76b1872..21208e8 100644 --- a/include/klay/rmi/socket.h +++ b/include/klay/rmi/socket.h @@ -20,6 +20,7 @@ #include #include +namespace klay { namespace rmi { class KLAY_EXPORT SocketException: public runtime::Exception { @@ -68,4 +69,8 @@ private: }; } // namespace rmi +} // namespace klay + +namespace rmi = klay::rmi; + #endif //__RMI_SOCKET_H__ diff --git a/include/klay/serialize.h b/include/klay/serialize.h index 0fccf1b..90b5491 100644 --- a/include/klay/serialize.h +++ b/include/klay/serialize.h @@ -24,7 +24,7 @@ #include #include -namespace runtime { +namespace klay { template struct KLAY_EXPORT SerializableArgument { @@ -145,6 +145,8 @@ private: StorageType& storage; }; -} // namespace runtime +} // namespace klay + +namespace runtime = klay; #endif //__RUNTIME_SERIALIZER_H__ diff --git a/include/klay/testbench.h b/include/klay/testbench.h index 7ad16a1..bc7089b 100644 --- a/include/klay/testbench.h +++ b/include/klay/testbench.h @@ -34,6 +34,7 @@ using namespace std::chrono; auto ms = duration_cast(end - start); \ auto time = ms.count(); +namespace klay { namespace testbench { struct KLAY_EXPORT Source { @@ -169,4 +170,8 @@ void TestName##TestCase::standalone() return; \ } } // namespace testbench +} // namespace klay + +namespace testbench = klay::testbench; + #endif //!__KLAY_TESTBENCH_H__ diff --git a/include/klay/thread-pool.h b/include/klay/thread-pool.h index a0da024..24f238e 100644 --- a/include/klay/thread-pool.h +++ b/include/klay/thread-pool.h @@ -26,7 +26,7 @@ #include -namespace runtime { +namespace klay { class KLAY_EXPORT ThreadPool { public: @@ -44,6 +44,8 @@ private: bool stop; }; -} // namespace runtime +} // namespace klay + +namespace runtime = klay; #endif //__RUNTIME_THREAD_POOL_H__ diff --git a/include/klay/xml/document.h b/include/klay/xml/document.h index ed6af71..24ff52b 100644 --- a/include/klay/xml/document.h +++ b/include/klay/xml/document.h @@ -25,6 +25,7 @@ #include #include +namespace klay { namespace xml { class KLAY_EXPORT Document { @@ -45,4 +46,8 @@ private: }; } // namespace xml +} // namespace klay + +namespace xml = klay::xml; + #endif //__XML_DOCUMENT_H__ diff --git a/include/klay/xml/keepblanks.h b/include/klay/xml/keepblanks.h index 13dff45..76d5ac4 100644 --- a/include/klay/xml/keepblanks.h +++ b/include/klay/xml/keepblanks.h @@ -21,6 +21,7 @@ #include +namespace klay { namespace xml { class KLAY_EXPORT KeepBlanks { @@ -36,4 +37,8 @@ private: }; } // namespace xml +} // namespace klay + +namespace xml = klay::xml; + #endif //__XML_KEEPBLANKS_H__ diff --git a/include/klay/xml/node.h b/include/klay/xml/node.h index 09ece09..7693446 100644 --- a/include/klay/xml/node.h +++ b/include/klay/xml/node.h @@ -25,6 +25,7 @@ #include +namespace klay { namespace xml { class KLAY_EXPORT Node { @@ -58,4 +59,8 @@ private: }; } // namespace xml +} // namespace klay + +namespace xml = klay::xml; + #endif //__XML_NODE_H__ diff --git a/include/klay/xml/parser.h b/include/klay/xml/parser.h index bce6ca5..f5d7857 100644 --- a/include/klay/xml/parser.h +++ b/include/klay/xml/parser.h @@ -24,6 +24,7 @@ #include #include +namespace klay { namespace xml { class KLAY_EXPORT Parser { @@ -36,4 +37,8 @@ private: }; } // namespace xml +} // namespace klay + +namespace xml = klay::xml; + #endif //__XML_DOMPARSER_H__ diff --git a/src/audit/audit-trail.cpp b/src/audit/audit-trail.cpp index e9fe960..0de4ac2 100644 --- a/src/audit/audit-trail.cpp +++ b/src/audit/audit-trail.cpp @@ -15,7 +15,7 @@ */ #include -namespace audit { +namespace klay { AuditTrail::AuditTrail() { @@ -49,4 +49,4 @@ void AuditTrail::unsubscribe(const int fd) mainloop.removeEventSource(fd); } -} // namespace audit +} // namespace klay diff --git a/src/audit/console-sink.cpp b/src/audit/console-sink.cpp index 77c8de4..7922711 100644 --- a/src/audit/console-sink.cpp +++ b/src/audit/console-sink.cpp @@ -18,11 +18,11 @@ #include -namespace audit { +namespace klay { void ConsoleLogSink::sink(const std::string& message) { std::cout << message << std::flush; } -} // namespace audit +} // namespace klay diff --git a/src/audit/dlog-sink.cpp b/src/audit/dlog-sink.cpp index f5fdfb8..ae01bbf 100644 --- a/src/audit/dlog-sink.cpp +++ b/src/audit/dlog-sink.cpp @@ -21,7 +21,7 @@ #include #include -namespace audit { +namespace klay { DlogLogSink::DlogLogSink(const std::string& tag) : tag(tag) {} @@ -52,4 +52,4 @@ void DlogLogSink::sink(const std::string &message) } } -} // namespace audit +} // namespace klay diff --git a/src/audit/logger-core.cpp b/src/audit/logger-core.cpp index f052efc..d7f616a 100644 --- a/src/audit/logger-core.cpp +++ b/src/audit/logger-core.cpp @@ -16,7 +16,7 @@ #include -namespace audit { +namespace klay { std::unique_ptr LoggerCore::instance = nullptr; std::once_flag LoggerCore::flag; @@ -39,4 +39,4 @@ void LoggerCore::dispatch(LogSink* logSink, const std::string& message) logSink->sink(message); } -} // namespace audit +} // namespace klay diff --git a/src/audit/logger.cpp b/src/audit/logger.cpp index 667ed09..96b21f2 100644 --- a/src/audit/logger.cpp +++ b/src/audit/logger.cpp @@ -24,7 +24,7 @@ #include #include -namespace audit { +namespace klay { std::string LogLevelToString(const LogLevel level) { @@ -73,4 +73,4 @@ void Logger::log(LogSink* logSink, const LogRecord record) LoggerCore::GetInstance().dispatch(logSink, buffer.str()); } -} // namespace audit +} // namespace klay diff --git a/src/audit/null-sink.cpp b/src/audit/null-sink.cpp index 0c7550b..f140d3a 100644 --- a/src/audit/null-sink.cpp +++ b/src/audit/null-sink.cpp @@ -15,10 +15,10 @@ */ #include -namespace audit { +namespace klay { void NullLogSink::sink(const std::string& message) { }; -} // namespace audit +} // namespace klay diff --git a/src/auth/group.cpp b/src/auth/group.cpp index e306f64..b61aaf2 100644 --- a/src/auth/group.cpp +++ b/src/auth/group.cpp @@ -27,7 +27,7 @@ #include #include -namespace runtime { +namespace klay { Group::Group(const Group& group) : name(group.name), gid(group.gid) @@ -85,4 +85,4 @@ Group::Group() : { } -} // namespace Shadow +} // namespace klay diff --git a/src/auth/user.cpp b/src/auth/user.cpp index 3eba7d9..3e825f4 100644 --- a/src/auth/user.cpp +++ b/src/auth/user.cpp @@ -27,7 +27,7 @@ #include #include -namespace runtime { +namespace klay { User::User(const User& user) : name(user.name), uid(user.uid), gid(user.gid) @@ -86,4 +86,4 @@ User::User() : { } -} // namespace runtime +} // namespace klay diff --git a/src/cgroup.cpp b/src/cgroup.cpp index d136e7d..d643e69 100644 --- a/src/cgroup.cpp +++ b/src/cgroup.cpp @@ -30,7 +30,7 @@ #define NAME_PATTERN "^[A-Za-z_][A-Za-z0-9_-]*" #define PATH_PATTERN "(/*[A-Za-z_][A-Za-z0-9_-]*)*" -namespace runtime { +namespace klay { bool Cgroup::existSubsystem(const std::string& name) { @@ -215,4 +215,4 @@ const std::string Cgroup::getPath(const std::string& subsystem, const pid_t pid) return ret; } -} // namespace runtime +} // namespace klay diff --git a/src/db/column.cpp b/src/db/column.cpp index 7270986..0c8cdc1 100644 --- a/src/db/column.cpp +++ b/src/db/column.cpp @@ -15,6 +15,7 @@ */ #include +namespace klay { namespace database { Column::Column(const Statement& stmt, int idx) : @@ -68,3 +69,4 @@ int Column::getBytes() const } } // namespace database +} // namespace klay diff --git a/src/db/connection.cpp b/src/db/connection.cpp index 639970a..e39255f 100644 --- a/src/db/connection.cpp +++ b/src/db/connection.cpp @@ -18,6 +18,7 @@ #include #include +namespace klay { namespace database { Connection::Connection(const std::string& name, const int flags, bool integrityCheck) : @@ -64,3 +65,4 @@ int Connection::exec(const std::string& query) } } // namespace database +} // namespace klay diff --git a/src/db/statement.cpp b/src/db/statement.cpp index b56be20..9e03809 100644 --- a/src/db/statement.cpp +++ b/src/db/statement.cpp @@ -22,6 +22,7 @@ #include #include +namespace klay { namespace database { Statement::Statement(const Connection& db, const std::string& query) : @@ -223,3 +224,4 @@ void Statement::bind(const std::string& name) } } // namespace database +} // namespace klay diff --git a/src/dbus/connection.cpp b/src/dbus/connection.cpp index 6f9cc27..9724830 100644 --- a/src/dbus/connection.cpp +++ b/src/dbus/connection.cpp @@ -19,6 +19,7 @@ #include #include +namespace klay { namespace dbus { namespace { @@ -306,3 +307,4 @@ void Connection::onMethodCall(GDBusConnection* connection, } } // namespace dbus +} // namespace klay diff --git a/src/dbus/error.cpp b/src/dbus/error.cpp index 43f8fa9..e6ea3db 100644 --- a/src/dbus/error.cpp +++ b/src/dbus/error.cpp @@ -15,6 +15,7 @@ */ #include +namespace klay { namespace dbus { Error::Error() : @@ -45,3 +46,4 @@ Error::operator bool () const } } // namespace dbus +} // namespace klay diff --git a/src/dbus/introspection.cpp b/src/dbus/introspection.cpp index 05cffa2..22f752e 100644 --- a/src/dbus/introspection.cpp +++ b/src/dbus/introspection.cpp @@ -25,6 +25,7 @@ #include #include +namespace klay { namespace dbus { namespace { @@ -272,3 +273,4 @@ void Introspection::update(void) } } // namespace dbus +} // namespace klay diff --git a/src/dbus/signal.cpp b/src/dbus/signal.cpp index 2498ed8..f8f6694 100644 --- a/src/dbus/signal.cpp +++ b/src/dbus/signal.cpp @@ -18,6 +18,7 @@ #include #include +namespace klay { namespace dbus { namespace signal { @@ -87,3 +88,4 @@ void Receiver::unsubscribe(unsigned int id) const } // namespace signal } // namespace dbus +} // namespace klay diff --git a/src/dbus/variant.cpp b/src/dbus/variant.cpp index 423941d..679d3fd 100644 --- a/src/dbus/variant.cpp +++ b/src/dbus/variant.cpp @@ -15,6 +15,7 @@ */ #include +namespace klay { namespace dbus { Variant::Variant(GVariant* var) : @@ -136,3 +137,4 @@ bool VariantIterator::get(const std::string& format, ...) const } } // namespace dbus +} // namespace klay diff --git a/src/error.cpp b/src/error.cpp index b11f837..2047d5a 100644 --- a/src/error.cpp +++ b/src/error.cpp @@ -18,7 +18,7 @@ #include -namespace runtime { +namespace klay { int Error::lastErrorCode() { @@ -46,4 +46,4 @@ std::string GetSystemErrorMessage() return Error::message(); } -} // namespace runtime +} // namespace klay diff --git a/src/eventfd.cpp b/src/eventfd.cpp index 8a7a876..dd81c38 100644 --- a/src/eventfd.cpp +++ b/src/eventfd.cpp @@ -23,7 +23,7 @@ #include #include -namespace runtime { +namespace klay { EventFD::EventFD(unsigned int initval, int flags) { @@ -61,4 +61,4 @@ void EventFD::receive() } } -} // namespace runtime +} // namespace klay diff --git a/src/exception.cpp b/src/exception.cpp index e7cd928..737edae 100644 --- a/src/exception.cpp +++ b/src/exception.cpp @@ -16,7 +16,7 @@ #include #include -namespace runtime { +namespace klay { const char *Exception::name() const { @@ -39,4 +39,4 @@ EXCEPTION_IMPLEMENT(TimeoutException, "Timeout") EXCEPTION_IMPLEMENT(NoPermissionException, "No permission") EXCEPTION_IMPLEMENT(OutOfMemoryException, "Out of memory") EXCEPTION_IMPLEMENT(IOException, "I/O error") -} // namespace runtime +} // namespace klay diff --git a/src/file-descriptor.cpp b/src/file-descriptor.cpp index 2f23524..11ab2a6 100644 --- a/src/file-descriptor.cpp +++ b/src/file-descriptor.cpp @@ -18,7 +18,7 @@ #include -namespace runtime { +namespace klay { FileDescriptor::~FileDescriptor() { @@ -44,4 +44,4 @@ FileDescriptor& FileDescriptor::operator=(FileDescriptor&& rhs) return *this; } -} // namespace runtime +} // namespace klay diff --git a/src/file-user.cpp b/src/file-user.cpp index ed12735..038f05a 100644 --- a/src/file-user.cpp +++ b/src/file-user.cpp @@ -24,7 +24,7 @@ #include #include -namespace runtime { +namespace klay { bool FileUser::isUsedAsFD(const std::string &filePath, const pid_t pid, bool isMount) { @@ -139,4 +139,4 @@ std::vector FileUser::getList(const std::string &path, bool isMount) return list; } -} // namespace runtime +} // namespace klay diff --git a/src/filesystem.cpp b/src/filesystem.cpp index 69dd909..80fd074 100644 --- a/src/filesystem.cpp +++ b/src/filesystem.cpp @@ -32,7 +32,7 @@ #include #include -namespace runtime { +namespace klay { File::File(const std::string& pathname, int flags) : File(pathname) @@ -566,4 +566,4 @@ void Mount::mountEntry(const std::string& src, const std::string& dest, const st } } -} // namespace runtime +} // namespace klay diff --git a/src/mainloop.cpp b/src/mainloop.cpp index 0188e12..1cff11b 100644 --- a/src/mainloop.cpp +++ b/src/mainloop.cpp @@ -29,7 +29,7 @@ #define MAX_EPOLL_EVENTS 16 -namespace runtime { +namespace klay { Mainloop::Mainloop() : pollFd(::epoll_create1(EPOLL_CLOEXEC)), @@ -152,4 +152,4 @@ void Mainloop::run(int timeout) } } -} // namespace runtime +} // namespace klay diff --git a/src/namespace.cpp b/src/namespace.cpp index c52d9d4..1b16ef1 100644 --- a/src/namespace.cpp +++ b/src/namespace.cpp @@ -22,7 +22,7 @@ #include #include -namespace runtime { +namespace klay { namespace { @@ -77,4 +77,4 @@ void Namespace::unshare(int flags) } } -} // namespace runtime +} // namespace klay diff --git a/src/netlink/netlink.cpp b/src/netlink/netlink.cpp index 2b86d26..9199d0a 100644 --- a/src/netlink/netlink.cpp +++ b/src/netlink/netlink.cpp @@ -25,6 +25,7 @@ #include #include +namespace klay { namespace netlink { Netlink::Netlink(int protocol) : @@ -144,3 +145,4 @@ Netlink::Message Netlink::recv(int options) } } // namespace runtime +} // namespace klay diff --git a/src/pam.cpp b/src/pam.cpp index f2daf70..84cb6f3 100644 --- a/src/pam.cpp +++ b/src/pam.cpp @@ -23,7 +23,7 @@ #include #include -namespace runtime { +namespace klay { PAM::PAM(const std::string& service, const std::string& user) { @@ -161,4 +161,4 @@ void PAM::closeSession(int flags) } } -} // namespace runtime +} // namespace klay diff --git a/src/process.cpp b/src/process.cpp index ffb9844..9b2f583 100644 --- a/src/process.cpp +++ b/src/process.cpp @@ -23,7 +23,7 @@ #include #include -namespace runtime { +namespace klay { Process::Process(const std::string& prog) : status(-1), pid(-1), program(prog) @@ -97,4 +97,4 @@ void Process::terminate() } } -} // namespace runtime +} // namespace klay diff --git a/src/rmi/client.cpp b/src/rmi/client.cpp index c4e7f03..d29c75a 100644 --- a/src/rmi/client.cpp +++ b/src/rmi/client.cpp @@ -16,6 +16,7 @@ #include #include +namespace klay { namespace rmi { void DefaultExceptionModel::raise(const std::string& target, const std::string& msg) @@ -41,3 +42,4 @@ void DefaultExceptionModel::raise(const std::string& target, const std::string& } } // namespace rmi +} // namespace klay diff --git a/src/rmi/connection.cpp b/src/rmi/connection.cpp index b46bbfa..04e5095 100644 --- a/src/rmi/connection.cpp +++ b/src/rmi/connection.cpp @@ -18,6 +18,7 @@ #include +namespace klay { namespace rmi { Connection::Connection(Socket&& sock) : @@ -56,3 +57,4 @@ Message Connection::dispatch() const } } // namespace rmi +} // namespace klay diff --git a/src/rmi/message-composer.cpp b/src/rmi/message-composer.cpp index 92f3456..fb2c7ce 100644 --- a/src/rmi/message-composer.cpp +++ b/src/rmi/message-composer.cpp @@ -22,6 +22,7 @@ #include #include +namespace klay { namespace rmi { MessageComposer::MessageComposer(size_t caps) : @@ -161,3 +162,4 @@ void MessageComposer::reserve(size_t size) } } // namespae rmi +} // namespae klay diff --git a/src/rmi/message.cpp b/src/rmi/message.cpp index 9dcaa28..e09329f 100644 --- a/src/rmi/message.cpp +++ b/src/rmi/message.cpp @@ -16,6 +16,7 @@ #include #include +namespace klay { namespace rmi { std::atomic Message::sequence(0); @@ -107,3 +108,4 @@ template<> void Message::disclose(runtime::FileDescriptor& fd) } } // namespace rmi +} // namespace klay diff --git a/src/rmi/notification.cpp b/src/rmi/notification.cpp index 81edc9b..f071777 100644 --- a/src/rmi/notification.cpp +++ b/src/rmi/notification.cpp @@ -21,6 +21,7 @@ #include #include +namespace klay { namespace rmi { Notification::Notification() @@ -69,3 +70,4 @@ int Notification::removeSubscriber(const int id) } } // namespace rmi +} // namespace klay diff --git a/src/rmi/service.cpp b/src/rmi/service.cpp index df4c570..3265291 100644 --- a/src/rmi/service.cpp +++ b/src/rmi/service.cpp @@ -24,6 +24,7 @@ #include #include +namespace klay { namespace rmi { thread_local Service::ProcessingContext Service::processingContext; @@ -243,3 +244,4 @@ void Service::onMessageProcess(const std::shared_ptr& connection) } } // namespace rmi +} // namespace klay diff --git a/src/rmi/socket.cpp b/src/rmi/socket.cpp index c6dae17..3e2e372 100644 --- a/src/rmi/socket.cpp +++ b/src/rmi/socket.cpp @@ -29,6 +29,7 @@ #include #include +namespace klay { namespace rmi { namespace { @@ -320,4 +321,5 @@ Socket Socket::connect(const std::string& path) return Socket(fd); } -} // namespace Ipc +} // namespace rmi +} // namespace klay diff --git a/src/testbench.cpp b/src/testbench.cpp index 3f668dd..d4718cc 100644 --- a/src/testbench.cpp +++ b/src/testbench.cpp @@ -22,6 +22,7 @@ using namespace console; +namespace klay { namespace testbench { Source::Source(const std::string& file, long line, const std::string& msg) : @@ -179,3 +180,4 @@ void Testbench::run() } } //namespace testbench +} //namespace klay diff --git a/src/thread-pool.cpp b/src/thread-pool.cpp index ee20c86..e5cc45c 100644 --- a/src/thread-pool.cpp +++ b/src/thread-pool.cpp @@ -23,7 +23,7 @@ #define __BEGIN_CRITICAL__ { std::unique_lock lock(this->queueMutex); #define __END_CRITICAL__ } -namespace runtime { +namespace klay { ThreadPool::ThreadPool(size_t threads) : stop(false) @@ -75,4 +75,4 @@ void ThreadPool::submit(std::function&& task) condition.notify_one(); } -} // namespace runtime +} // namespace klay diff --git a/src/xml/document.cpp b/src/xml/document.cpp index 30ebf47..b49d7a7 100644 --- a/src/xml/document.cpp +++ b/src/xml/document.cpp @@ -22,6 +22,7 @@ #include #include +namespace klay { namespace xml { Document::Document(const std::string& root, const std::string& version) : @@ -132,3 +133,4 @@ void Document::write(const std::string& filename, const std::string& encoding, b } } // namespace xml +} // namespace klay diff --git a/src/xml/keepblanks.cpp b/src/xml/keepblanks.cpp index 5077c3e..32c909f 100644 --- a/src/xml/keepblanks.cpp +++ b/src/xml/keepblanks.cpp @@ -15,6 +15,7 @@ */ #include +namespace klay { namespace xml { KeepBlanks::KeepBlanks(bool value) @@ -30,3 +31,4 @@ KeepBlanks::~KeepBlanks() } } // namespace xml +} // namespace klay diff --git a/src/xml/node.cpp b/src/xml/node.cpp index 9a6e6b2..a0055d0 100644 --- a/src/xml/node.cpp +++ b/src/xml/node.cpp @@ -16,6 +16,7 @@ #include #include +namespace klay { namespace xml { Node::Node(xmlNode* node) : @@ -113,3 +114,4 @@ bool Node::isBlank() const } } // namespace xml +} // namespace klay diff --git a/src/xml/parser.cpp b/src/xml/parser.cpp index a20c888..ddae583 100644 --- a/src/xml/parser.cpp +++ b/src/xml/parser.cpp @@ -19,6 +19,7 @@ #include #include +namespace klay { namespace xml { Document* Parser::parseContext(xmlParserCtxt* context, bool validate) @@ -80,3 +81,4 @@ Document* Parser::parseString(const std::string& xml, bool validate) } } // namespace xml +} // namespace klay