Put WebResult into a seperate file

This commit is contained in:
fearlessTobi 2018-10-26 17:01:00 +02:00
parent 6fb6737642
commit d28233961b
4 changed files with 29 additions and 18 deletions

View file

@ -90,6 +90,7 @@ add_library(common STATIC
timer.cpp timer.cpp
timer.h timer.h
vector_math.h vector_math.h
web_result.h
) )
if(ARCHITECTURE_x86_64) if(ARCHITECTURE_x86_64)

View file

@ -9,23 +9,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "common/common_types.h" #include "common/common_types.h"
#include "common/web_result.h"
namespace Common {
struct WebResult {
enum class Code : u32 {
Success,
InvalidURL,
CredentialsMissing,
LibError,
HttpError,
WrongContent,
NoWebservice,
};
Code result_code;
std::string result_string;
std::string returned_data;
};
} // namespace Common
namespace AnnounceMultiplayerRoom { namespace AnnounceMultiplayerRoom {

25
src/common/web_result.h Normal file
View file

@ -0,0 +1,25 @@
// Copyright 2018 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#pragma once
#include <string>
#include "common/common_types.h"
namespace Common {
struct WebResult {
enum class Code : u32 {
Success,
InvalidURL,
CredentialsMissing,
LibError,
HttpError,
WrongContent,
NoWebservice,
};
Code result_code;
std::string result_string;
std::string returned_data;
};
} // namespace Common

View file

@ -2,14 +2,15 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include <array>
#include <cstdlib> #include <cstdlib>
#include <mutex> #include <mutex>
#include <string> #include <string>
#include <LUrlParser.h> #include <LUrlParser.h>
#include <httplib.h> #include <httplib.h>
#include "common/announce_multiplayer_room.h"
#include "common/common_types.h" #include "common/common_types.h"
#include "common/logging/log.h" #include "common/logging/log.h"
#include "common/web_result.h"
#include "web_service/web_backend.h" #include "web_service/web_backend.h"
namespace WebService { namespace WebService {