mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-08 06:31:50 +08:00
Reorganized source tree. Moved client.cpp into cmd/synergy as
synergy.cpp and server.cpp into cmd/synergyd as synergyd.cpp. Moved and renamed related files. Moved remaining source files into lib/.... Modified and added makefiles as appropriate. Result is that library files are under lib with each library in its own directory and program files are under cmd with each command in its own directory.
This commit is contained in:
79
lib/net/XNetwork.cpp
Normal file
79
lib/net/XNetwork.cpp
Normal file
@@ -0,0 +1,79 @@
|
||||
#include "XNetwork.h"
|
||||
|
||||
//
|
||||
// XNetworkUnavailable
|
||||
//
|
||||
|
||||
CString
|
||||
XNetworkUnavailable::getWhat() const throw()
|
||||
{
|
||||
return format("XNetworkUnavailable", "network library is not available");
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// XNetworkFailed
|
||||
//
|
||||
|
||||
CString
|
||||
XNetworkFailed::getWhat() const throw()
|
||||
{
|
||||
return format("XNetworkFailed", "cannot initialize network library");
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// XNetworkVersion
|
||||
//
|
||||
|
||||
XNetworkVersion::XNetworkVersion(int major, int minor) throw() :
|
||||
m_major(major),
|
||||
m_minor(minor)
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
int
|
||||
XNetworkVersion::getMajor() const throw()
|
||||
{
|
||||
return m_major;
|
||||
}
|
||||
|
||||
int
|
||||
XNetworkVersion::getMinor() const throw()
|
||||
{
|
||||
return m_minor;
|
||||
}
|
||||
|
||||
CString
|
||||
XNetworkVersion::getWhat() const throw()
|
||||
{
|
||||
return format("XNetworkVersion",
|
||||
"unsupported network version %{1}.%{2}",
|
||||
CStringUtil::print("%d", m_major).c_str(),
|
||||
CStringUtil::print("%d", m_minor).c_str());
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// XNetworkFunctionUnavailable
|
||||
//
|
||||
|
||||
XNetworkFunctionUnavailable::XNetworkFunctionUnavailable(
|
||||
const char* name) throw()
|
||||
{
|
||||
try {
|
||||
m_name = name;
|
||||
}
|
||||
catch (...) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
CString
|
||||
XNetworkFunctionUnavailable::getWhat() const throw()
|
||||
{
|
||||
return format("XNetworkFunctionUnavailable",
|
||||
"missing network function %{1}",
|
||||
m_name.c_str());
|
||||
}
|
||||
Reference in New Issue
Block a user