win_runtime_error moved to WinStd; eapxml functions return HRESULT now

This commit is contained in:
2016-08-09 01:05:00 +02:00
parent b71e30f642
commit 1bf51fda25
23 changed files with 315 additions and 454 deletions

View File

@@ -1,80 +0,0 @@
/*
Copyright 2015-2016 Amebis
Copyright 2016 G<>ANT
This file is part of G<>ANTLink.
G<>ANTLink is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
G<>ANTLink is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with G<>ANTLink. If not, see <http://www.gnu.org/licenses/>.
*/
#include "StdAfx.h"
using namespace std;
using namespace winstd;
//////////////////////////////////////////////////////////////////////
// eap::win_runtime_error
//////////////////////////////////////////////////////////////////////
eap::win_runtime_error::win_runtime_error(_In_ DWORD error, _In_ const tstring& msg) :
m_error(error),
m_msg(msg),
runtime_error("")
{
}
eap::win_runtime_error::win_runtime_error(_In_ DWORD error, _In_z_ const TCHAR *msg) :
m_error(error),
m_msg(msg),
runtime_error("")
{
}
eap::win_runtime_error::win_runtime_error(_In_ const tstring& msg) :
m_error(GetLastError()),
m_msg(msg),
runtime_error("")
{
}
eap::win_runtime_error::win_runtime_error(_In_z_ const TCHAR *msg) :
m_error(GetLastError()),
m_msg(msg),
runtime_error("")
{
}
eap::win_runtime_error::win_runtime_error(const win_runtime_error &other) :
m_error(other.m_error),
m_msg(other.m_msg),
runtime_error(other.what())
{
}
eap::win_runtime_error& eap::win_runtime_error::operator=(const win_runtime_error &other)
{
if (this != addressof(other)) {
*(runtime_error*)this = other;
m_error = other.m_error;
m_msg = other.m_msg;
}
return *this;
}