mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-07-09 17:25:18 -06:00
Merge branch 'master' into fix-macos-arrow-keys
This commit is contained in:
commit
99d4d9e5f6
2
3rdparty/pugixml
vendored
2
3rdparty/pugixml
vendored
@ -1 +1 @@
|
||||
Subproject commit ee86beb30e4973f5feffe3ce63bfa4fbadf72f38
|
||||
Subproject commit c8033ce9d039e7f9d134877c363397b3cfe20816
|
||||
@ -921,6 +921,13 @@ std::string_view fmt::trim_front_sv(std::string_view source, std::string_view va
|
||||
void fmt::trim_back(std::string& source, std::string_view values)
|
||||
{
|
||||
const usz index = source.find_last_not_of(values);
|
||||
|
||||
if (index == source.npos)
|
||||
{
|
||||
source.clear();
|
||||
return;
|
||||
}
|
||||
|
||||
source.resize(index + 1);
|
||||
}
|
||||
|
||||
|
||||
@ -117,6 +117,13 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rpcs3_test", "rpcs3\tests\r
|
||||
{70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12} = {70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "pugixml", "pugixml", "{F520F4A6-27D1-4DD2-9BB2-E0625826D0A3}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
3rdparty\pugixml\src\pugiconfig.hpp = 3rdparty\pugixml\src\pugiconfig.hpp
|
||||
3rdparty\pugixml\src\pugixml.cpp = 3rdparty\pugixml\src\pugixml.cpp
|
||||
3rdparty\pugixml\src\pugixml.hpp = 3rdparty\pugixml\src\pugixml.hpp
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
@ -274,6 +281,7 @@ Global
|
||||
{8846A9AA-5539-4C91-8301-F54260E1A07A} = {6C3B64A0-8F8A-4DC4-8C0B-D71EBEED7FA8}
|
||||
{3C67A2FF-4710-402A-BE3E-31B0CB0576DF} = {6C3B64A0-8F8A-4DC4-8C0B-D71EBEED7FA8}
|
||||
{D1CBF84E-07F8-4ACB-9CD2-BD205FDEEE1E} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
|
||||
{F520F4A6-27D1-4DD2-9BB2-E0625826D0A3} = {6C3B64A0-8F8A-4DC4-8C0B-D71EBEED7FA8}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {06CC7920-E085-4B81-9582-8DE8AAD42510}
|
||||
|
||||
@ -3670,6 +3670,23 @@ public:
|
||||
#endif
|
||||
}
|
||||
|
||||
template <typename T1, typename T2, typename T3>
|
||||
value_t<u32[4]> vperm2d128From512(T1 a, T2 b, T3 c)
|
||||
{
|
||||
value_t<u32[4]> result;
|
||||
value_t<u32[16]> perm512;
|
||||
|
||||
const auto data0 = a.eval(m_ir);
|
||||
const auto index128 = b.eval(m_ir);
|
||||
const auto data1 = c.eval(m_ir);
|
||||
|
||||
const auto index512 = m_ir->CreateInsertVector(get_type<u32[16]>(), llvm::UndefValue::get(get_type<u32[16]>()), index128, m_ir->getInt64(0));
|
||||
perm512.value = m_ir->CreateCall(get_intrinsic(llvm::Intrinsic::x86_avx512_vpermi2var_d_512), {data0, index512, data1});
|
||||
|
||||
result.value = m_ir->CreateExtractVector(get_type<u32[4]>(), perm512.value, m_ir->getInt64(0));
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T1, typename T2>
|
||||
value_t<u8[16]> gf2p8affineqb(T1 a, T2 b, u8 c)
|
||||
{
|
||||
|
||||
@ -72,7 +72,7 @@ struct music_export
|
||||
};
|
||||
|
||||
|
||||
bool check_music_path(const std::string& file_path)
|
||||
bool check_music_path(std::string_view file_path)
|
||||
{
|
||||
if (file_path.size() >= CELL_MUSIC_EXPORT_UTIL_HDD_PATH_MAX)
|
||||
{
|
||||
|
||||
@ -74,7 +74,7 @@ struct photo_export
|
||||
};
|
||||
|
||||
|
||||
bool check_photo_path(const std::string& file_path)
|
||||
bool check_photo_path(std::string_view file_path)
|
||||
{
|
||||
if (file_path.size() >= CELL_PHOTO_EXPORT_UTIL_HDD_PATH_MAX)
|
||||
{
|
||||
|
||||
@ -75,7 +75,7 @@ error_code cellSslGetMemoryInfo()
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
std::string getCert(const std::string& certPath, const int certID, const bool isNormalCert)
|
||||
std::string getCert(std::string_view certPath, const int certID, const bool isNormalCert)
|
||||
{
|
||||
int newID = certID;
|
||||
|
||||
|
||||
@ -76,7 +76,7 @@ struct video_export
|
||||
};
|
||||
|
||||
|
||||
bool check_movie_path(const std::string& file_path)
|
||||
bool check_movie_path(std::string_view file_path)
|
||||
{
|
||||
if (file_path.size() >= CELL_VIDEO_EXPORT_UTIL_HDD_PATH_MAX)
|
||||
{
|
||||
|
||||
@ -7498,13 +7498,23 @@ public:
|
||||
const auto a_sign = (a & splat<u32[4]>(0x80000000));
|
||||
value_t<u32[4]> final_result = eval(splat<u32[4]>(0));
|
||||
|
||||
for (u32 i = 0; i < 4; i++)
|
||||
if (m_use_avx512)
|
||||
{
|
||||
const auto eval_fraction = eval(extract(a_fraction, i));
|
||||
value_t<u32[16]> lo_lut;
|
||||
value_t<u32[16]> hi_lut;
|
||||
lo_lut.value = llvm::ConstantDataVector::get(m_context, llvm::ArrayRef(spu_frest_fraction_lut, 16));
|
||||
hi_lut.value = llvm::ConstantDataVector::get(m_context, llvm::ArrayRef(spu_frest_fraction_lut + 16, 16));
|
||||
|
||||
value_t<u32> r_fraction = load_const<u32>(m_spu_frest_fraction_lut, eval_fraction);
|
||||
|
||||
final_result = eval(insert(final_result, i, r_fraction));
|
||||
final_result = vperm2d128From512(lo_lut, a_fraction, hi_lut);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (u32 i = 0; i < 4; i++)
|
||||
{
|
||||
const auto eval_fraction = eval(extract(a_fraction, i));
|
||||
value_t<u32> r_fraction = load_const<u32>(m_spu_frest_fraction_lut, eval_fraction);
|
||||
final_result = eval(insert(final_result, i, r_fraction));
|
||||
}
|
||||
}
|
||||
|
||||
//final_result = eval(select(final_result != (0), final_result, bitcast<u32[4]>(pshufb(splat<u8[16]>(0), bitcast<u8[16]>(final_result)))));
|
||||
@ -8551,13 +8561,23 @@ public:
|
||||
const auto a_sign = (a & splat<u32[4]>(0x80000000));
|
||||
value_t<u32[4]> b = eval(splat<u32[4]>(0));
|
||||
|
||||
for (u32 i = 0; i < 4; i++)
|
||||
if (m_use_avx512)
|
||||
{
|
||||
const auto eval_fraction = eval(extract(a_fraction, i));
|
||||
value_t<u32[16]> lo_lut;
|
||||
value_t<u32[16]> hi_lut;
|
||||
lo_lut.value = llvm::ConstantDataVector::get(m_context, llvm::ArrayRef(spu_frest_fraction_lut, 16));
|
||||
hi_lut.value = llvm::ConstantDataVector::get(m_context, llvm::ArrayRef(spu_frest_fraction_lut + 16, 16));
|
||||
|
||||
value_t<u32> r_fraction = load_const<u32>(m_spu_frest_fraction_lut, eval_fraction);
|
||||
|
||||
b = eval(insert(b, i, r_fraction));
|
||||
b = vperm2d128From512(lo_lut, a_fraction, hi_lut);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (u32 i = 0; i < 4; i++)
|
||||
{
|
||||
const auto eval_fraction = eval(extract(a_fraction, i));
|
||||
value_t<u32> r_fraction = load_const<u32>(m_spu_frest_fraction_lut, eval_fraction);
|
||||
b = eval(insert(b, i, r_fraction));
|
||||
}
|
||||
}
|
||||
|
||||
b = eval(b | fix_exponent | a_sign);
|
||||
|
||||
@ -102,7 +102,7 @@ std::string u32_to_padded_hex(u32 value)
|
||||
template <typename T>
|
||||
T hex_to(std::string_view val)
|
||||
{
|
||||
T result;
|
||||
T result {};
|
||||
auto [ptr, err] = std::from_chars(val.data(), val.data() + val.size(), result, 16);
|
||||
if (err != std::errc())
|
||||
{
|
||||
@ -361,7 +361,7 @@ void gdb_thread::ack(bool accepted)
|
||||
send_char(accepted ? '+' : '-');
|
||||
}
|
||||
|
||||
void gdb_thread::send_cmd(const std::string& cmd)
|
||||
void gdb_thread::send_cmd(std::string_view cmd)
|
||||
{
|
||||
u8 checksum = 0;
|
||||
std::string buf;
|
||||
@ -376,7 +376,7 @@ void gdb_thread::send_cmd(const std::string& cmd)
|
||||
send(buf.c_str(), static_cast<int>(buf.length()));
|
||||
}
|
||||
|
||||
bool gdb_thread::send_cmd_ack(const std::string& cmd)
|
||||
bool gdb_thread::send_cmd_ack(std::string_view cmd)
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
@ -465,7 +465,7 @@ std::string gdb_thread::get_reg(ppu_thread* thread, u32 rid)
|
||||
}
|
||||
}
|
||||
|
||||
bool gdb_thread::set_reg(ppu_thread* thread, u32 rid, const std::string& value)
|
||||
bool gdb_thread::set_reg(ppu_thread* thread, u32 rid, std::string_view value)
|
||||
{
|
||||
switch (rid)
|
||||
{
|
||||
|
||||
@ -44,10 +44,10 @@ class gdb_thread
|
||||
//acknowledge packet, either as accepted or declined
|
||||
void ack(bool accepted);
|
||||
//sends command body cmd to client
|
||||
void send_cmd(const std::string& cmd);
|
||||
void send_cmd(std::string_view cmd);
|
||||
//sends command to client until receives positive acknowledgement
|
||||
//returns false in case some error happened, and command wasn't sent
|
||||
bool send_cmd_ack(const std::string& cmd);
|
||||
bool send_cmd_ack(std::string_view cmd);
|
||||
//appends encoded char c to string str, and returns checksum. encoded byte can occupy 2 bytes
|
||||
static u8 append_encoded_char(char c, std::string& str);
|
||||
//convert u8 to 2 byte hexademical representation
|
||||
@ -57,7 +57,7 @@ class gdb_thread
|
||||
//returns register value as hex string by register id (in gdb), in case of wrong id returns empty string
|
||||
static std::string get_reg(ppu_thread* thread, u32 rid);
|
||||
//sets register value to hex string by register id (in gdb), in case of wrong id returns false
|
||||
static bool set_reg(ppu_thread* thread, u32 rid, const std::string& value);
|
||||
static bool set_reg(ppu_thread* thread, u32 rid, std::string_view value);
|
||||
//returns size of register with id rid in bytes, zero if invalid rid is provided
|
||||
static u32 get_reg_size(ppu_thread* thread, u32 rid);
|
||||
//send reason of stop, returns false if sending response failed
|
||||
|
||||
@ -230,8 +230,8 @@ namespace clan
|
||||
CURL* curl = ctx->curl;
|
||||
|
||||
ClanRequestType req_type = ClanRequestType::FUNC;
|
||||
const pugi::xml_node clan = xml_body.child("clan");
|
||||
if (clan && clan.child("ticket"))
|
||||
const pugi::xml_node clan = xml_body.child("clan"sv);
|
||||
if (clan && clan.child("ticket"sv))
|
||||
{
|
||||
req_type = ClanRequestType::SEC;
|
||||
}
|
||||
@ -296,11 +296,11 @@ namespace clan
|
||||
return SCE_NP_CLANS_ERROR_BAD_RESPONSE;
|
||||
}
|
||||
|
||||
const pugi::xml_node clan_result = out_response.child("clan");
|
||||
const pugi::xml_node clan_result = out_response.child("clan"sv);
|
||||
if (!clan_result)
|
||||
return SCE_NP_CLANS_ERROR_BAD_RESPONSE;
|
||||
|
||||
const pugi::xml_attribute result = clan_result.attribute("result");
|
||||
const pugi::xml_attribute result = clan_result.attribute("result"sv);
|
||||
if (!result)
|
||||
return SCE_NP_CLANS_ERROR_BAD_RESPONSE;
|
||||
|
||||
@ -358,11 +358,11 @@ namespace clan
|
||||
return SCE_NP_CLANS_ERROR_SERVICE_UNAVAILABLE;
|
||||
|
||||
pugi::xml_document doc = pugi::xml_document();
|
||||
pugi::xml_node clan = doc.append_child("clan");
|
||||
pugi::xml_node clan = doc.append_child("clan"sv);
|
||||
|
||||
clan.append_child("ticket").text().set(ticket.c_str());
|
||||
clan.append_child("start").text().set(paging.startPos);
|
||||
clan.append_child("max").text().set(paging.max);
|
||||
clan.append_child("ticket"sv).text().set(ticket);
|
||||
clan.append_child("start"sv).text().set(paging.startPos);
|
||||
clan.append_child("max"sv).text().set(paging.max);
|
||||
|
||||
pugi::xml_document response = pugi::xml_document();
|
||||
const SceNpClansError clan_res = send_request(req_id, ClanRequestAction::GetClanList, ClanManagerOperationType::VIEW, doc, response);
|
||||
@ -370,37 +370,37 @@ namespace clan
|
||||
if (clan_res != SCE_NP_CLANS_SUCCESS)
|
||||
return clan_res;
|
||||
|
||||
const pugi::xml_node clan_result = response.child("clan");
|
||||
const pugi::xml_node list = clan_result.child("list");
|
||||
const pugi::xml_node clan_result = response.child("clan"sv);
|
||||
const pugi::xml_node list = clan_result.child("list"sv);
|
||||
|
||||
const pugi::xml_attribute results = list.attribute("results");
|
||||
const pugi::xml_attribute results = list.attribute("results"sv);
|
||||
const uint32_t results_count = results.as_uint();
|
||||
|
||||
const pugi::xml_attribute total = list.attribute("total");
|
||||
const pugi::xml_attribute total = list.attribute("total"sv);
|
||||
const uint32_t total_count = total.as_uint();
|
||||
|
||||
int i = 0;
|
||||
for (pugi::xml_node info = list.child("info"); info; info = info.next_sibling("info"), i++)
|
||||
for (pugi::xml_node info = list.child("info"sv); info; info = info.next_sibling("info"sv), i++)
|
||||
{
|
||||
const pugi::xml_attribute id = info.attribute("id");
|
||||
const pugi::xml_attribute id = info.attribute("id"sv);
|
||||
const uint32_t clan_id = id.as_uint();
|
||||
|
||||
const pugi::xml_node name = info.child("name");
|
||||
const pugi::xml_node name = info.child("name"sv);
|
||||
const std::string name_str = name.text().as_string();
|
||||
|
||||
const pugi::xml_node tag = info.child("tag");
|
||||
const pugi::xml_node tag = info.child("tag"sv);
|
||||
const std::string tag_str = tag.text().as_string();
|
||||
|
||||
const pugi::xml_node role = info.child("role");
|
||||
const pugi::xml_node role = info.child("role"sv);
|
||||
const int32_t role_int = role.text().as_uint();
|
||||
|
||||
const pugi::xml_node status = info.child("status");
|
||||
const pugi::xml_node status = info.child("status"sv);
|
||||
const uint32_t status_int = status.text().as_uint();
|
||||
|
||||
const pugi::xml_node onlinename = info.child("onlinename");
|
||||
const pugi::xml_node onlinename = info.child("onlinename"sv);
|
||||
const std::string onlinename_str = onlinename.text().as_string();
|
||||
|
||||
const pugi::xml_node members = info.child("members");
|
||||
const pugi::xml_node members = info.child("members"sv);
|
||||
const uint32_t members_int = members.text().as_uint();
|
||||
|
||||
SceNpClansEntry entry = SceNpClansEntry{
|
||||
@ -431,8 +431,8 @@ namespace clan
|
||||
SceNpClansError clans_client::get_clan_info(u32 req_id, SceNpClanId clan_id, SceNpClansClanInfo& clan_info)
|
||||
{
|
||||
pugi::xml_document doc = pugi::xml_document();
|
||||
pugi::xml_node clan = doc.append_child("clan");
|
||||
clan.append_child("id").text().set(clan_id);
|
||||
pugi::xml_node clan = doc.append_child("clan"sv);
|
||||
clan.append_child("id"sv).text().set(clan_id);
|
||||
|
||||
pugi::xml_document response = pugi::xml_document();
|
||||
const SceNpClansError clan_res = send_request(req_id, ClanRequestAction::GetClanInfo, ClanManagerOperationType::VIEW, doc, response);
|
||||
@ -440,14 +440,14 @@ namespace clan
|
||||
if (clan_res != SCE_NP_CLANS_SUCCESS)
|
||||
return clan_res;
|
||||
|
||||
const pugi::xml_node clan_result = response.child("clan");
|
||||
const pugi::xml_node info = clan_result.child("info");
|
||||
const pugi::xml_node clan_result = response.child("clan"sv);
|
||||
const pugi::xml_node info = clan_result.child("info"sv);
|
||||
|
||||
const std::string name_str = info.child("name").text().as_string();
|
||||
const std::string tag_str = info.child("tag").text().as_string();
|
||||
const uint32_t members_int = info.child("members").text().as_uint();
|
||||
const std::string date_created_str = info.child("date-created").text().as_string();
|
||||
const std::string description_str = info.child("description").text().as_string();
|
||||
const std::string name_str = info.child("name"sv).text().as_string();
|
||||
const std::string tag_str = info.child("tag"sv).text().as_string();
|
||||
const uint32_t members_int = info.child("members"sv).text().as_uint();
|
||||
const std::string date_created_str = info.child("date-created"sv).text().as_string();
|
||||
const std::string description_str = info.child("description"sv).text().as_string();
|
||||
|
||||
clan_info = SceNpClansClanInfo{
|
||||
.info = SceNpClansClanBasicInfo{
|
||||
@ -474,12 +474,12 @@ namespace clan
|
||||
return SCE_NP_CLANS_ERROR_SERVICE_UNAVAILABLE;
|
||||
|
||||
pugi::xml_document doc = pugi::xml_document();
|
||||
pugi::xml_node clan = doc.append_child("clan");
|
||||
clan.append_child("ticket").text().set(ticket.c_str());
|
||||
clan.append_child("id").text().set(clan_id);
|
||||
pugi::xml_node clan = doc.append_child("clan"sv);
|
||||
clan.append_child("ticket"sv).text().set(ticket);
|
||||
clan.append_child("id"sv).text().set(clan_id);
|
||||
|
||||
const std::string jid_str = fmt::format(JID_FORMAT, np::npid_to_string(np_id));
|
||||
clan.append_child("jid").text().set(jid_str.c_str());
|
||||
clan.append_child("jid"sv).text().set(jid_str);
|
||||
|
||||
pugi::xml_document response = pugi::xml_document();
|
||||
const SceNpClansError clan_res = send_request(req_id, ClanRequestAction::GetMemberInfo, ClanManagerOperationType::VIEW, doc, response);
|
||||
@ -487,10 +487,10 @@ namespace clan
|
||||
if (clan_res != SCE_NP_CLANS_SUCCESS)
|
||||
return clan_res;
|
||||
|
||||
const pugi::xml_node clan_result = response.child("clan");
|
||||
const pugi::xml_node member_info = clan_result.child("info");
|
||||
const pugi::xml_node clan_result = response.child("clan"sv);
|
||||
const pugi::xml_node member_info = clan_result.child("info"sv);
|
||||
|
||||
const pugi::xml_attribute member_jid = member_info.attribute("jid");
|
||||
const pugi::xml_attribute member_jid = member_info.attribute("jid"sv);
|
||||
const std::string member_jid_str = member_jid.as_string();
|
||||
const std::string member_username = fmt::split(member_jid_str, {"@"})[0];
|
||||
|
||||
@ -504,13 +504,13 @@ namespace clan
|
||||
np::string_to_npid(member_username, member_npid);
|
||||
}
|
||||
|
||||
const pugi::xml_node role = member_info.child("role");
|
||||
const pugi::xml_node role = member_info.child("role"sv);
|
||||
const uint32_t role_int = role.text().as_uint();
|
||||
|
||||
const pugi::xml_node status = member_info.child("status");
|
||||
const pugi::xml_node status = member_info.child("status"sv);
|
||||
const uint32_t status_int = status.text().as_uint();
|
||||
|
||||
const pugi::xml_node description = member_info.child("description");
|
||||
const pugi::xml_node description = member_info.child("description"sv);
|
||||
const std::string description_str = description.text().as_string();
|
||||
|
||||
mem_info = SceNpClansMemberEntry
|
||||
@ -535,11 +535,11 @@ namespace clan
|
||||
return SCE_NP_CLANS_ERROR_SERVICE_UNAVAILABLE;
|
||||
|
||||
pugi::xml_document doc = pugi::xml_document();
|
||||
pugi::xml_node clan = doc.append_child("clan");
|
||||
clan.append_child("ticket").text().set(ticket.c_str());
|
||||
clan.append_child("id").text().set(clan_id);
|
||||
clan.append_child("start").text().set(paging.startPos);
|
||||
clan.append_child("max").text().set(paging.max);
|
||||
pugi::xml_node clan = doc.append_child("clan"sv);
|
||||
clan.append_child("ticket"sv).text().set(ticket);
|
||||
clan.append_child("id"sv).text().set(clan_id);
|
||||
clan.append_child("start"sv).text().set(paging.startPos);
|
||||
clan.append_child("max"sv).text().set(paging.max);
|
||||
|
||||
pugi::xml_document response = pugi::xml_document();
|
||||
const SceNpClansError clan_res = send_request(req_id, ClanRequestAction::GetMemberList, ClanManagerOperationType::VIEW, doc, response);
|
||||
@ -547,19 +547,19 @@ namespace clan
|
||||
if (clan_res != SCE_NP_CLANS_SUCCESS)
|
||||
return clan_res;
|
||||
|
||||
const pugi::xml_node clan_result = response.child("clan");
|
||||
const pugi::xml_node list = clan_result.child("list");
|
||||
const pugi::xml_node clan_result = response.child("clan"sv);
|
||||
const pugi::xml_node list = clan_result.child("list"sv);
|
||||
|
||||
const pugi::xml_attribute results = list.attribute("results");
|
||||
const pugi::xml_attribute results = list.attribute("results"sv);
|
||||
const uint32_t results_count = results.as_uint();
|
||||
|
||||
const pugi::xml_attribute total = list.attribute("total");
|
||||
const pugi::xml_attribute total = list.attribute("total"sv);
|
||||
const uint32_t total_count = total.as_uint();
|
||||
|
||||
int i = 0;
|
||||
for (pugi::xml_node member_info = list.child("info"); member_info; member_info = member_info.next_sibling("info"))
|
||||
for (pugi::xml_node member_info = list.child("info"sv); member_info; member_info = member_info.next_sibling("info"sv))
|
||||
{
|
||||
const std::string member_jid = member_info.attribute("jid").as_string();
|
||||
const std::string member_jid = member_info.attribute("jid"sv).as_string();
|
||||
const std::string member_username = fmt::split(member_jid, {"@"})[0];
|
||||
|
||||
SceNpId member_npid;
|
||||
@ -572,9 +572,9 @@ namespace clan
|
||||
np::string_to_npid(member_username, member_npid);
|
||||
}
|
||||
|
||||
const uint32_t role_int = member_info.child("role").text().as_uint();
|
||||
const uint32_t status_int = member_info.child("status").text().as_uint();
|
||||
const std::string description_str = member_info.child("description").text().as_string();
|
||||
const uint32_t role_int = member_info.child("role"sv).text().as_uint();
|
||||
const uint32_t status_int = member_info.child("status"sv).text().as_uint();
|
||||
const std::string description_str = member_info.child("description"sv).text().as_string();
|
||||
|
||||
SceNpClansMemberEntry entry = SceNpClansMemberEntry
|
||||
{
|
||||
@ -603,11 +603,11 @@ namespace clan
|
||||
const std::string ticket = get_clan_ticket(nph);
|
||||
|
||||
pugi::xml_document doc = pugi::xml_document();
|
||||
pugi::xml_node clan = doc.append_child("clan");
|
||||
clan.append_child("ticket").text().set(ticket.c_str());
|
||||
clan.append_child("id").text().set(clan_id);
|
||||
clan.append_child("start").text().set(paging.startPos);
|
||||
clan.append_child("max").text().set(paging.max);
|
||||
pugi::xml_node clan = doc.append_child("clan"sv);
|
||||
clan.append_child("ticket"sv).text().set(ticket);
|
||||
clan.append_child("id"sv).text().set(clan_id);
|
||||
clan.append_child("start"sv).text().set(paging.startPos);
|
||||
clan.append_child("max"sv).text().set(paging.max);
|
||||
|
||||
pugi::xml_document response = pugi::xml_document();
|
||||
const SceNpClansError clan_res = send_request(req_id, ClanRequestAction::GetBlacklist, ClanManagerOperationType::VIEW, doc, response);
|
||||
@ -615,19 +615,19 @@ namespace clan
|
||||
if (clan_res != SCE_NP_CLANS_SUCCESS)
|
||||
return clan_res;
|
||||
|
||||
const pugi::xml_node clan_result = response.child("clan");
|
||||
const pugi::xml_node list = clan_result.child("list");
|
||||
const pugi::xml_node clan_result = response.child("clan"sv);
|
||||
const pugi::xml_node list = clan_result.child("list"sv);
|
||||
|
||||
const pugi::xml_attribute results = list.attribute("results");
|
||||
const pugi::xml_attribute results = list.attribute("results"sv);
|
||||
const uint32_t results_count = results.as_uint();
|
||||
|
||||
const pugi::xml_attribute total = list.attribute("total");
|
||||
const pugi::xml_attribute total = list.attribute("total"sv);
|
||||
const uint32_t total_count = total.as_uint();
|
||||
|
||||
int i = 0;
|
||||
for (pugi::xml_node member = list.child("entry"); member; member = member.next_sibling("entry"))
|
||||
for (pugi::xml_node member = list.child("entry"sv); member; member = member.next_sibling("entry"sv))
|
||||
{
|
||||
const pugi::xml_node member_jid = member.child("jid");
|
||||
const pugi::xml_node member_jid = member.child("jid"sv);
|
||||
const std::string member_jid_str = member_jid.text().as_string();
|
||||
const std::string member_username = fmt::split(member_jid_str, {"@"})[0];
|
||||
|
||||
@ -638,7 +638,7 @@ namespace clan
|
||||
}
|
||||
else
|
||||
{
|
||||
np::string_to_npid(member_username.c_str(), member_npid);
|
||||
np::string_to_npid(member_username, member_npid);
|
||||
}
|
||||
|
||||
SceNpClansBlacklistEntry entry = SceNpClansBlacklistEntry
|
||||
@ -666,12 +666,12 @@ namespace clan
|
||||
return SCE_NP_CLANS_ERROR_SERVICE_UNAVAILABLE;
|
||||
|
||||
pugi::xml_document doc = pugi::xml_document();
|
||||
pugi::xml_node clan = doc.append_child("clan");
|
||||
clan.append_child("ticket").text().set(ticket.c_str());
|
||||
clan.append_child("id").text().set(clan_id);
|
||||
pugi::xml_node clan = doc.append_child("clan"sv);
|
||||
clan.append_child("ticket"sv).text().set(ticket);
|
||||
clan.append_child("id"sv).text().set(clan_id);
|
||||
|
||||
const std::string jid_str = fmt::format(JID_FORMAT, np::npid_to_string(np_id));
|
||||
clan.append_child("jid").text().set(jid_str.c_str());
|
||||
clan.append_child("jid"sv).text().set(jid_str);
|
||||
|
||||
pugi::xml_document response = pugi::xml_document();
|
||||
return send_request(req_id, ClanRequestAction::RecordBlacklistEntry, ClanManagerOperationType::UPDATE, doc, response);
|
||||
@ -684,12 +684,12 @@ namespace clan
|
||||
return SCE_NP_CLANS_ERROR_SERVICE_UNAVAILABLE;
|
||||
|
||||
pugi::xml_document doc = pugi::xml_document();
|
||||
pugi::xml_node clan = doc.append_child("clan");
|
||||
clan.append_child("ticket").text().set(ticket.c_str());
|
||||
clan.append_child("id").text().set(clan_id);
|
||||
pugi::xml_node clan = doc.append_child("clan"sv);
|
||||
clan.append_child("ticket"sv).text().set(ticket);
|
||||
clan.append_child("id"sv).text().set(clan_id);
|
||||
|
||||
const std::string jid_str = fmt::format(JID_FORMAT, np::npid_to_string(np_id));
|
||||
clan.append_child("jid").text().set(jid_str.c_str());
|
||||
clan.append_child("jid"sv).text().set(jid_str);
|
||||
|
||||
pugi::xml_document response = pugi::xml_document();
|
||||
return send_request(req_id, ClanRequestAction::DeleteBlacklistEntry, ClanManagerOperationType::UPDATE, doc, response);
|
||||
@ -698,16 +698,16 @@ namespace clan
|
||||
SceNpClansError clans_client::clan_search(u32 req_id, const SceNpClansPagingRequest& paging, const SceNpClansSearchableName& search, std::vector<SceNpClansClanBasicInfo>& clan_list, SceNpClansPagingResult& page_result)
|
||||
{
|
||||
pugi::xml_document doc = pugi::xml_document();
|
||||
pugi::xml_node clan = doc.append_child("clan");
|
||||
clan.append_child("start").text().set(paging.startPos);
|
||||
clan.append_child("max").text().set(paging.max);
|
||||
pugi::xml_node clan = doc.append_child("clan"sv);
|
||||
clan.append_child("start"sv).text().set(paging.startPos);
|
||||
clan.append_child("max"sv).text().set(paging.max);
|
||||
|
||||
pugi::xml_node filter = clan.append_child("filter");
|
||||
pugi::xml_node name = filter.append_child("name");
|
||||
pugi::xml_node filter = clan.append_child("filter"sv);
|
||||
pugi::xml_node name = filter.append_child("name"sv);
|
||||
|
||||
const std::string op_name = fmt::format("%s", static_cast<ClanSearchFilterOperator>(static_cast<s32>(search.nameSearchOp)));
|
||||
name.append_attribute("op").set_value(op_name.c_str());
|
||||
name.append_attribute("value").set_value(search.name);
|
||||
name.append_attribute("op"sv).set_value(op_name);
|
||||
name.append_attribute("value"sv).set_value(search.name);
|
||||
|
||||
pugi::xml_document response = pugi::xml_document();
|
||||
const SceNpClansError clan_res = send_request(req_id, ClanRequestAction::ClanSearch, ClanManagerOperationType::VIEW, doc, response);
|
||||
@ -715,22 +715,22 @@ namespace clan
|
||||
if (clan_res != SCE_NP_CLANS_SUCCESS)
|
||||
return clan_res;
|
||||
|
||||
const pugi::xml_node clan_result = response.child("clan");
|
||||
const pugi::xml_node list = clan_result.child("list");
|
||||
const pugi::xml_node clan_result = response.child("clan"sv);
|
||||
const pugi::xml_node list = clan_result.child("list"sv);
|
||||
|
||||
const pugi::xml_attribute results = list.attribute("results");
|
||||
const pugi::xml_attribute results = list.attribute("results"sv);
|
||||
const uint32_t results_count = results.as_uint();
|
||||
|
||||
const pugi::xml_attribute total = list.attribute("total");
|
||||
const pugi::xml_attribute total = list.attribute("total"sv);
|
||||
const uint32_t total_count = total.as_uint();
|
||||
|
||||
int i = 0;
|
||||
for (pugi::xml_node node = list.child("info"); node; node = node.next_sibling("info"))
|
||||
for (pugi::xml_node node = list.child("info"sv); node; node = node.next_sibling("info"sv))
|
||||
{
|
||||
const uint32_t clan_id = node.attribute("id").as_uint();
|
||||
const std::string name_str = node.child("name").text().as_string();
|
||||
const std::string tag_str = node.child("tag").text().as_string();
|
||||
const uint32_t members_int = node.child("members").text().as_uint();
|
||||
const uint32_t clan_id = node.attribute("id"sv).as_uint();
|
||||
const std::string name_str = node.child("name"sv).text().as_string();
|
||||
const std::string tag_str = node.child("tag"sv).text().as_string();
|
||||
const uint32_t members_int = node.child("members"sv).text().as_uint();
|
||||
|
||||
SceNpClansClanBasicInfo entry = SceNpClansClanBasicInfo
|
||||
{
|
||||
@ -764,11 +764,11 @@ namespace clan
|
||||
return SCE_NP_CLANS_ERROR_SERVICE_UNAVAILABLE;
|
||||
|
||||
pugi::xml_document doc = pugi::xml_document();
|
||||
pugi::xml_node clan = doc.append_child("clan");
|
||||
clan.append_child("ticket").text().set(ticket.c_str());
|
||||
pugi::xml_node clan = doc.append_child("clan"sv);
|
||||
clan.append_child("ticket"sv).text().set(ticket);
|
||||
|
||||
clan.append_child("name").text().set(name.data());
|
||||
clan.append_child("tag").text().set(tag.data());
|
||||
clan.append_child("name"sv).text().set(name.data());
|
||||
clan.append_child("tag"sv).text().set(tag.data());
|
||||
|
||||
pugi::xml_document response = pugi::xml_document();
|
||||
const SceNpClansError clan_res = send_request(req_id, ClanRequestAction::CreateClan, ClanManagerOperationType::UPDATE, doc, response);
|
||||
@ -776,8 +776,8 @@ namespace clan
|
||||
if (clan_res != SCE_NP_CLANS_SUCCESS)
|
||||
return clan_res;
|
||||
|
||||
const pugi::xml_node clan_result = response.child("clan");
|
||||
const pugi::xml_attribute id = clan_result.attribute("id");
|
||||
const pugi::xml_node clan_result = response.child("clan"sv);
|
||||
const pugi::xml_attribute id = clan_result.attribute("id"sv);
|
||||
const uint32_t clan_id_int = id.as_uint();
|
||||
|
||||
*clan_id = clan_id_int;
|
||||
@ -792,9 +792,9 @@ namespace clan
|
||||
return SCE_NP_CLANS_ERROR_SERVICE_UNAVAILABLE;
|
||||
|
||||
pugi::xml_document doc = pugi::xml_document();
|
||||
pugi::xml_node clan = doc.append_child("clan");
|
||||
clan.append_child("ticket").text().set(ticket.c_str());
|
||||
clan.append_child("id").text().set(clan_id);
|
||||
pugi::xml_node clan = doc.append_child("clan"sv);
|
||||
clan.append_child("ticket"sv).text().set(ticket);
|
||||
clan.append_child("id"sv).text().set(clan_id);
|
||||
|
||||
pugi::xml_document response = pugi::xml_document();
|
||||
const SceNpClansError clan_res = send_request(req_id, ClanRequestAction::DisbandClan, ClanManagerOperationType::UPDATE, doc, response);
|
||||
@ -812,9 +812,9 @@ namespace clan
|
||||
return SCE_NP_CLANS_ERROR_SERVICE_UNAVAILABLE;
|
||||
|
||||
pugi::xml_document doc = pugi::xml_document();
|
||||
pugi::xml_node clan = doc.append_child("clan");
|
||||
clan.append_child("ticket").text().set(ticket.c_str());
|
||||
clan.append_child("id").text().set(clan_id);
|
||||
pugi::xml_node clan = doc.append_child("clan"sv);
|
||||
clan.append_child("ticket"sv).text().set(ticket);
|
||||
clan.append_child("id"sv).text().set(clan_id);
|
||||
|
||||
pugi::xml_document response = pugi::xml_document();
|
||||
return send_request(req_id, ClanRequestAction::RequestMembership, ClanManagerOperationType::UPDATE, doc, response);
|
||||
@ -827,9 +827,9 @@ namespace clan
|
||||
return SCE_NP_CLANS_ERROR_SERVICE_UNAVAILABLE;
|
||||
|
||||
pugi::xml_document doc = pugi::xml_document();
|
||||
pugi::xml_node clan = doc.append_child("clan");
|
||||
clan.append_child("ticket").text().set(ticket.c_str());
|
||||
clan.append_child("id").text().set(clan_id);
|
||||
pugi::xml_node clan = doc.append_child("clan"sv);
|
||||
clan.append_child("ticket"sv).text().set(ticket);
|
||||
clan.append_child("id"sv).text().set(clan_id);
|
||||
|
||||
pugi::xml_document response = pugi::xml_document();
|
||||
return send_request(req_id, ClanRequestAction::CancelRequestMembership, ClanManagerOperationType::UPDATE, doc, response);
|
||||
@ -842,12 +842,12 @@ namespace clan
|
||||
return SCE_NP_CLANS_ERROR_SERVICE_UNAVAILABLE;
|
||||
|
||||
pugi::xml_document doc = pugi::xml_document();
|
||||
pugi::xml_node clan = doc.append_child("clan");
|
||||
clan.append_child("ticket").text().set(ticket.c_str());
|
||||
clan.append_child("id").text().set(clan_id);
|
||||
pugi::xml_node clan = doc.append_child("clan"sv);
|
||||
clan.append_child("ticket"sv).text().set(ticket);
|
||||
clan.append_child("id"sv).text().set(clan_id);
|
||||
|
||||
const std::string jid_str = fmt::format(JID_FORMAT, np::npid_to_string(np_id));
|
||||
clan.append_child("jid").text().set(jid_str.c_str());
|
||||
clan.append_child("jid"sv).text().set(jid_str);
|
||||
|
||||
pugi::xml_document response = pugi::xml_document();
|
||||
return send_request(req_id, allow ? ClanRequestAction::AcceptMembershipRequest : ClanRequestAction::DeclineMembershipRequest, ClanManagerOperationType::UPDATE, doc, response);
|
||||
@ -860,12 +860,12 @@ namespace clan
|
||||
return SCE_NP_CLANS_ERROR_SERVICE_UNAVAILABLE;
|
||||
|
||||
pugi::xml_document doc = pugi::xml_document();
|
||||
pugi::xml_node clan = doc.append_child("clan");
|
||||
clan.append_child("ticket").text().set(ticket.c_str());
|
||||
clan.append_child("id").text().set(clan_id);
|
||||
pugi::xml_node clan = doc.append_child("clan"sv);
|
||||
clan.append_child("ticket"sv).text().set(ticket);
|
||||
clan.append_child("id"sv).text().set(clan_id);
|
||||
|
||||
const std::string jid_str = fmt::format(JID_FORMAT, np::npid_to_string(np_id));
|
||||
clan.append_child("jid").text().set(jid_str.c_str());
|
||||
clan.append_child("jid"sv).text().set(jid_str);
|
||||
|
||||
pugi::xml_document response = pugi::xml_document();
|
||||
return send_request(req_id, ClanRequestAction::SendInvitation, ClanManagerOperationType::UPDATE, doc, response);
|
||||
@ -878,12 +878,12 @@ namespace clan
|
||||
return SCE_NP_CLANS_ERROR_SERVICE_UNAVAILABLE;
|
||||
|
||||
pugi::xml_document doc = pugi::xml_document();
|
||||
pugi::xml_node clan = doc.append_child("clan");
|
||||
clan.append_child("ticket").text().set(ticket.c_str());
|
||||
clan.append_child("id").text().set(clan_id);
|
||||
pugi::xml_node clan = doc.append_child("clan"sv);
|
||||
clan.append_child("ticket"sv).text().set(ticket);
|
||||
clan.append_child("id"sv).text().set(clan_id);
|
||||
|
||||
const std::string jid_str = fmt::format(JID_FORMAT, np::npid_to_string(np_id));
|
||||
clan.append_child("jid").text().set(jid_str.c_str());
|
||||
clan.append_child("jid"sv).text().set(jid_str);
|
||||
|
||||
pugi::xml_document response = pugi::xml_document();
|
||||
return send_request(req_id, ClanRequestAction::CancelInvitation, ClanManagerOperationType::UPDATE, doc, response);
|
||||
@ -896,9 +896,9 @@ namespace clan
|
||||
return SCE_NP_CLANS_ERROR_SERVICE_UNAVAILABLE;
|
||||
|
||||
pugi::xml_document doc = pugi::xml_document();
|
||||
pugi::xml_node clan = doc.append_child("clan");
|
||||
clan.append_child("ticket").text().set(ticket.c_str());
|
||||
clan.append_child("id").text().set(clan_id);
|
||||
pugi::xml_node clan = doc.append_child("clan"sv);
|
||||
clan.append_child("ticket"sv).text().set(ticket);
|
||||
clan.append_child("id"sv).text().set(clan_id);
|
||||
|
||||
pugi::xml_document response = pugi::xml_document();
|
||||
return send_request(req_id, accept ? ClanRequestAction::AcceptInvitation : ClanRequestAction::DeclineInvitation, ClanManagerOperationType::UPDATE, doc, response);
|
||||
@ -911,17 +911,17 @@ namespace clan
|
||||
return SCE_NP_CLANS_ERROR_SERVICE_UNAVAILABLE;
|
||||
|
||||
pugi::xml_document doc = pugi::xml_document();
|
||||
pugi::xml_node clan = doc.append_child("clan");
|
||||
clan.append_child("ticket").text().set(ticket.c_str());
|
||||
clan.append_child("id").text().set(clan_id);
|
||||
pugi::xml_node clan = doc.append_child("clan"sv);
|
||||
clan.append_child("ticket"sv).text().set(ticket);
|
||||
clan.append_child("id"sv).text().set(clan_id);
|
||||
|
||||
pugi::xml_node role = clan.append_child("onlinename");
|
||||
role.text().set(np::npid_to_string(nph.get_npid()).c_str());
|
||||
pugi::xml_node role = clan.append_child("onlinename"sv);
|
||||
role.text().set(np::npid_to_string(nph.get_npid()));
|
||||
|
||||
pugi::xml_node description = clan.append_child("description");
|
||||
pugi::xml_node description = clan.append_child("description"sv);
|
||||
description.text().set(info.description);
|
||||
|
||||
pugi::xml_node status = clan.append_child("bin-attr1");
|
||||
pugi::xml_node status = clan.append_child("bin-attr1"sv);
|
||||
|
||||
byte bin_attr_1[SCE_NP_CLANS_MEMBER_BINARY_ATTRIBUTE1_MAX_SIZE * 2 + 1] = {0};
|
||||
uint32_t bin_attr_1_size = UINT32_MAX;
|
||||
@ -933,10 +933,10 @@ namespace clan
|
||||
// `reinterpret_cast` used to let the compiler select the correct overload of `set`
|
||||
status.text().set(reinterpret_cast<const char*>(bin_attr_1));
|
||||
|
||||
pugi::xml_node allow_msg = clan.append_child("allow-msg");
|
||||
pugi::xml_node allow_msg = clan.append_child("allow-msg"sv);
|
||||
allow_msg.text().set(static_cast<uint32_t>(info.allowMsg));
|
||||
|
||||
pugi::xml_node size = clan.append_child("size");
|
||||
pugi::xml_node size = clan.append_child("size"sv);
|
||||
size.text().set(info.binData1Size);
|
||||
|
||||
pugi::xml_document response = pugi::xml_document();
|
||||
@ -950,13 +950,13 @@ namespace clan
|
||||
return SCE_NP_CLANS_ERROR_SERVICE_UNAVAILABLE;
|
||||
|
||||
pugi::xml_document doc = pugi::xml_document();
|
||||
pugi::xml_node clan = doc.append_child("clan");
|
||||
clan.append_child("ticket").text().set(ticket.c_str());
|
||||
clan.append_child("id").text().set(clan_id);
|
||||
pugi::xml_node clan = doc.append_child("clan"sv);
|
||||
clan.append_child("ticket"sv).text().set(ticket);
|
||||
clan.append_child("id"sv).text().set(clan_id);
|
||||
|
||||
// TODO: implement binary and integer attributes (not implemented in server yet)
|
||||
|
||||
pugi::xml_node description = clan.append_child("description");
|
||||
pugi::xml_node description = clan.append_child("description"sv);
|
||||
description.text().set(info.description);
|
||||
|
||||
pugi::xml_document response = pugi::xml_document();
|
||||
@ -970,9 +970,9 @@ namespace clan
|
||||
return SCE_NP_CLANS_ERROR_SERVICE_UNAVAILABLE;
|
||||
|
||||
pugi::xml_document doc = pugi::xml_document();
|
||||
pugi::xml_node clan = doc.append_child("clan");
|
||||
clan.append_child("ticket").text().set(ticket.c_str());
|
||||
clan.append_child("id").text().set(clan_id);
|
||||
pugi::xml_node clan = doc.append_child("clan"sv);
|
||||
clan.append_child("ticket"sv).text().set(ticket);
|
||||
clan.append_child("id"sv).text().set(clan_id);
|
||||
|
||||
pugi::xml_document response = pugi::xml_document();
|
||||
return send_request(req_id, ClanRequestAction::JoinClan, ClanManagerOperationType::UPDATE, doc, response);
|
||||
@ -985,9 +985,9 @@ namespace clan
|
||||
return SCE_NP_CLANS_ERROR_SERVICE_UNAVAILABLE;
|
||||
|
||||
pugi::xml_document doc = pugi::xml_document();
|
||||
pugi::xml_node clan = doc.append_child("clan");
|
||||
clan.append_child("ticket").text().set(ticket.c_str());
|
||||
clan.append_child("id").text().set(clan_id);
|
||||
pugi::xml_node clan = doc.append_child("clan"sv);
|
||||
clan.append_child("ticket"sv).text().set(ticket);
|
||||
clan.append_child("id"sv).text().set(clan_id);
|
||||
|
||||
pugi::xml_document response = pugi::xml_document();
|
||||
return send_request(req_id, ClanRequestAction::LeaveClan, ClanManagerOperationType::UPDATE, doc, response);
|
||||
@ -1000,12 +1000,12 @@ namespace clan
|
||||
return SCE_NP_CLANS_ERROR_SERVICE_UNAVAILABLE;
|
||||
|
||||
pugi::xml_document doc = pugi::xml_document();
|
||||
pugi::xml_node clan = doc.append_child("clan");
|
||||
clan.append_child("ticket").text().set(ticket.c_str());
|
||||
clan.append_child("id").text().set(clan_id);
|
||||
pugi::xml_node clan = doc.append_child("clan"sv);
|
||||
clan.append_child("ticket"sv).text().set(ticket);
|
||||
clan.append_child("id"sv).text().set(clan_id);
|
||||
|
||||
const std::string jid_str = fmt::format(JID_FORMAT, np::npid_to_string(np_id));
|
||||
clan.append_child("jid").text().set(jid_str.c_str());
|
||||
clan.append_child("jid"sv).text().set(jid_str);
|
||||
|
||||
pugi::xml_document response = pugi::xml_document();
|
||||
return send_request(req_id, ClanRequestAction::KickMember, ClanManagerOperationType::UPDATE, doc, response);
|
||||
@ -1018,14 +1018,14 @@ namespace clan
|
||||
return SCE_NP_CLANS_ERROR_SERVICE_UNAVAILABLE;
|
||||
|
||||
pugi::xml_document doc = pugi::xml_document();
|
||||
pugi::xml_node clan = doc.append_child("clan");
|
||||
clan.append_child("ticket").text().set(ticket.c_str());
|
||||
clan.append_child("id").text().set(clan_id);
|
||||
pugi::xml_node clan = doc.append_child("clan"sv);
|
||||
clan.append_child("ticket"sv).text().set(ticket);
|
||||
clan.append_child("id"sv).text().set(clan_id);
|
||||
|
||||
const std::string jid_str = fmt::format(JID_FORMAT, np::npid_to_string(np_id));
|
||||
clan.append_child("jid").text().set(jid_str.c_str());
|
||||
clan.append_child("jid"sv).text().set(jid_str);
|
||||
|
||||
pugi::xml_node role_node = clan.append_child("role");
|
||||
pugi::xml_node role_node = clan.append_child("role"sv);
|
||||
role_node.text().set(static_cast<uint32_t>(role));
|
||||
|
||||
pugi::xml_document response = pugi::xml_document();
|
||||
@ -1039,11 +1039,11 @@ namespace clan
|
||||
return SCE_NP_CLANS_ERROR_SERVICE_UNAVAILABLE;
|
||||
|
||||
pugi::xml_document doc = pugi::xml_document();
|
||||
pugi::xml_node clan = doc.append_child("clan");
|
||||
clan.append_child("ticket").text().set(ticket.c_str());
|
||||
clan.append_child("id").text().set(clan_id);
|
||||
clan.append_child("start").text().set(paging.startPos);
|
||||
clan.append_child("max").text().set(paging.max);
|
||||
pugi::xml_node clan = doc.append_child("clan"sv);
|
||||
clan.append_child("ticket"sv).text().set(ticket);
|
||||
clan.append_child("id"sv).text().set(clan_id);
|
||||
clan.append_child("start"sv).text().set(paging.startPos);
|
||||
clan.append_child("max"sv).text().set(paging.max);
|
||||
|
||||
pugi::xml_document response = pugi::xml_document();
|
||||
const SceNpClansError clan_res = send_request(req_id, ClanRequestAction::RetrieveAnnouncements, ClanManagerOperationType::VIEW, doc, response);
|
||||
@ -1051,25 +1051,25 @@ namespace clan
|
||||
if (clan_res != SCE_NP_CLANS_SUCCESS)
|
||||
return clan_res;
|
||||
|
||||
const pugi::xml_node clan_result = response.child("clan");
|
||||
const pugi::xml_node list = clan_result.child("list");
|
||||
const pugi::xml_node clan_result = response.child("clan"sv);
|
||||
const pugi::xml_node list = clan_result.child("list"sv);
|
||||
|
||||
const pugi::xml_attribute results = list.attribute("results");
|
||||
const pugi::xml_attribute results = list.attribute("results"sv);
|
||||
const uint32_t results_count = results.as_uint();
|
||||
|
||||
const pugi::xml_attribute total = list.attribute("total");
|
||||
const pugi::xml_attribute total = list.attribute("total"sv);
|
||||
const uint32_t total_count = total.as_uint();
|
||||
|
||||
int i = 0;
|
||||
for (pugi::xml_node node = list.child("msg-info"); node; node = node.next_sibling("msg-info"))
|
||||
for (pugi::xml_node node = list.child("msg-info"sv); node; node = node.next_sibling("msg-info"sv))
|
||||
{
|
||||
const pugi::xml_attribute id = node.attribute("id");
|
||||
const pugi::xml_attribute id = node.attribute("id"sv);
|
||||
const uint32_t msg_id = id.as_uint();
|
||||
|
||||
const std::string subject_str = node.child("subject").text().as_string();
|
||||
const std::string msg_str = node.child("msg").text().as_string();
|
||||
const std::string author_jid = node.child("jid").text().as_string();
|
||||
const std::string msg_date = node.child("msg-date").text().as_string();
|
||||
const std::string subject_str = node.child("subject"sv).text().as_string();
|
||||
const std::string msg_str = node.child("msg"sv).text().as_string();
|
||||
const std::string author_jid = node.child("jid"sv).text().as_string();
|
||||
const std::string msg_date = node.child("msg-date"sv).text().as_string();
|
||||
|
||||
SceNpId author_npid;
|
||||
const std::string author_username = fmt::split(author_jid, {"@"})[0];
|
||||
@ -1119,17 +1119,17 @@ namespace clan
|
||||
return SCE_NP_CLANS_ERROR_SERVICE_UNAVAILABLE;
|
||||
|
||||
pugi::xml_document doc = pugi::xml_document();
|
||||
pugi::xml_node clan = doc.append_child("clan");
|
||||
clan.append_child("ticket").text().set(ticket.c_str());
|
||||
clan.append_child("id").text().set(clan_id);
|
||||
pugi::xml_node clan = doc.append_child("clan"sv);
|
||||
clan.append_child("ticket"sv).text().set(ticket);
|
||||
clan.append_child("id"sv).text().set(clan_id);
|
||||
|
||||
pugi::xml_node subject = clan.append_child("subject");
|
||||
pugi::xml_node subject = clan.append_child("subject"sv);
|
||||
subject.text().set(announcement.subject);
|
||||
|
||||
pugi::xml_node msg = clan.append_child("msg");
|
||||
pugi::xml_node msg = clan.append_child("msg"sv);
|
||||
msg.text().set(announcement.body);
|
||||
|
||||
pugi::xml_node expire_date = clan.append_child("expire-date");
|
||||
pugi::xml_node expire_date = clan.append_child("expire-date"sv);
|
||||
expire_date.text().set(duration);
|
||||
|
||||
pugi::xml_document response = pugi::xml_document();
|
||||
@ -1138,8 +1138,8 @@ namespace clan
|
||||
if (clan_res != SCE_NP_CLANS_SUCCESS)
|
||||
return clan_res;
|
||||
|
||||
const pugi::xml_node clan_result = response.child("clan");
|
||||
const pugi::xml_node msg_id_node = clan_result.child("id");
|
||||
const pugi::xml_node clan_result = response.child("clan"sv);
|
||||
const pugi::xml_node msg_id_node = clan_result.child("id"sv);
|
||||
msg_id = msg_id_node.text().as_uint();
|
||||
|
||||
return SCE_NP_CLANS_SUCCESS;
|
||||
@ -1152,10 +1152,10 @@ namespace clan
|
||||
return SCE_NP_CLANS_ERROR_SERVICE_UNAVAILABLE;
|
||||
|
||||
pugi::xml_document doc = pugi::xml_document();
|
||||
pugi::xml_node clan = doc.append_child("clan");
|
||||
clan.append_child("ticket").text().set(ticket.c_str());
|
||||
clan.append_child("id").text().set(clan_id);
|
||||
clan.append_child("msg-id").text().set(announcement_id);
|
||||
pugi::xml_node clan = doc.append_child("clan"sv);
|
||||
clan.append_child("ticket"sv).text().set(ticket);
|
||||
clan.append_child("id"sv).text().set(clan_id);
|
||||
clan.append_child("msg-id"sv).text().set(announcement_id);
|
||||
|
||||
pugi::xml_document response = pugi::xml_document();
|
||||
return send_request(req_id, ClanRequestAction::DeleteAnnouncement, ClanManagerOperationType::UPDATE, doc, response);
|
||||
|
||||
@ -66,7 +66,7 @@ namespace np
|
||||
return sockaddr_ipv6;
|
||||
}
|
||||
|
||||
u32 register_ip(const std::string& ip_bytes)
|
||||
u32 register_ip(std::string_view ip_bytes)
|
||||
{
|
||||
if (ip_bytes.size() == 4)
|
||||
{
|
||||
|
||||
@ -66,7 +66,7 @@ namespace np
|
||||
std::vector<std::array<u8, 16>> ipv4_to_ipv6;
|
||||
};
|
||||
|
||||
u32 register_ip(const std::string& ip_bytes);
|
||||
u32 register_ip(std::string_view ip_bytes);
|
||||
|
||||
enum class IPV6_SUPPORT : u8
|
||||
{
|
||||
|
||||
@ -1303,7 +1303,7 @@ namespace np
|
||||
}
|
||||
}
|
||||
|
||||
bool np_handler::error_and_disconnect(const std::string& error_msg)
|
||||
bool np_handler::error_and_disconnect(std::string_view error_msg)
|
||||
{
|
||||
rpcn_log.error("%s", error_msg);
|
||||
rpcn.reset();
|
||||
|
||||
@ -267,7 +267,7 @@ namespace np
|
||||
error_code abort_request(u32 req_id);
|
||||
|
||||
// For signaling
|
||||
void req_sign_infos(const std::string& npid, u32 conn_id);
|
||||
void req_sign_infos(std::string_view npid, u32 conn_id);
|
||||
|
||||
// For UPNP
|
||||
void upnp_add_port_mapping(u16 internal_port, std::string_view protocol);
|
||||
@ -297,7 +297,7 @@ namespace np
|
||||
// Various generic helpers
|
||||
bool discover_ip_address();
|
||||
bool discover_ether_address();
|
||||
bool error_and_disconnect(const std::string& error_msg);
|
||||
bool error_and_disconnect(std::string_view error_msg);
|
||||
|
||||
// Notification handlers
|
||||
void notif_user_joined_room(vec_stream& noti);
|
||||
|
||||
@ -814,7 +814,7 @@ namespace np
|
||||
cb_info_opt->queue_callback(req_id, 0, error_code, 0);
|
||||
}
|
||||
|
||||
void np_handler::req_sign_infos(const std::string& npid, u32 conn_id)
|
||||
void np_handler::req_sign_infos(std::string_view npid, u32 conn_id)
|
||||
{
|
||||
const u32 req_id = get_req_id(REQUEST_ID_HIGH::MISC);
|
||||
{
|
||||
|
||||
@ -967,7 +967,7 @@ namespace rpcn
|
||||
server_info_received = false;
|
||||
}
|
||||
|
||||
bool rpcn_client::connect(const std::string& host)
|
||||
bool rpcn_client::connect(std::string_view host)
|
||||
{
|
||||
rpcn_log.warning("connect: Attempting to connect");
|
||||
|
||||
@ -1172,7 +1172,7 @@ namespace rpcn
|
||||
return true;
|
||||
}
|
||||
|
||||
bool rpcn_client::login(const std::string& npid, const std::string& password, const std::string& token)
|
||||
bool rpcn_client::login(std::string_view npid, std::string_view password, std::string_view token)
|
||||
{
|
||||
if (npid.empty())
|
||||
{
|
||||
@ -1338,7 +1338,7 @@ namespace rpcn
|
||||
return error;
|
||||
}
|
||||
|
||||
ErrorType rpcn_client::resend_token(const std::string& npid, const std::string& password)
|
||||
ErrorType rpcn_client::resend_token(std::string_view npid, std::string_view password)
|
||||
{
|
||||
if (authentified)
|
||||
{
|
||||
@ -1469,7 +1469,7 @@ namespace rpcn
|
||||
return error;
|
||||
}
|
||||
|
||||
std::optional<ErrorType> rpcn_client::add_friend(const std::string& friend_username)
|
||||
std::optional<ErrorType> rpcn_client::add_friend(std::string_view friend_username)
|
||||
{
|
||||
std::vector<u8> data;
|
||||
std::copy(friend_username.begin(), friend_username.end(), std::back_inserter(data));
|
||||
@ -1494,7 +1494,7 @@ namespace rpcn
|
||||
return error;
|
||||
}
|
||||
|
||||
bool rpcn_client::remove_friend(const std::string& friend_username)
|
||||
bool rpcn_client::remove_friend(std::string_view friend_username)
|
||||
{
|
||||
std::vector<u8> data;
|
||||
std::copy(friend_username.begin(), friend_username.end(), std::back_inserter(data));
|
||||
@ -2159,7 +2159,7 @@ namespace rpcn
|
||||
return forge_request_with_com_id(serialized, communication_id, CommandType::SendRoomMessage, req_id);
|
||||
}
|
||||
|
||||
bool rpcn_client::req_sign_infos(u32 req_id, const std::string& npid)
|
||||
bool rpcn_client::req_sign_infos(u32 req_id, std::string_view npid)
|
||||
{
|
||||
std::vector<u8> data;
|
||||
std::copy(npid.begin(), npid.end(), std::back_inserter(data));
|
||||
@ -2168,7 +2168,7 @@ namespace rpcn
|
||||
return forge_send(CommandType::RequestSignalingInfos, req_id, data);
|
||||
}
|
||||
|
||||
bool rpcn_client::req_ticket(u32 req_id, const std::string& service_id, const std::vector<u8>& cookie)
|
||||
bool rpcn_client::req_ticket(u32 req_id, std::string_view service_id, const std::vector<u8>& cookie)
|
||||
{
|
||||
std::vector<u8> data;
|
||||
std::copy(service_id.begin(), service_id.end(), std::back_inserter(data));
|
||||
@ -2859,7 +2859,7 @@ namespace rpcn
|
||||
memcpy(data.data(), com_id_str.data(), COMMUNICATION_ID_SIZE);
|
||||
}
|
||||
|
||||
bool rpcn_client::forge_request_with_com_id(const std::string& serialized_data, const SceNpCommunicationId& com_id, CommandType command, u64 packet_id)
|
||||
bool rpcn_client::forge_request_with_com_id(std::string_view serialized_data, const SceNpCommunicationId& com_id, CommandType command, u64 packet_id)
|
||||
{
|
||||
const usz bufsize = serialized_data.size();
|
||||
std::vector<u8> data(COMMUNICATION_ID_SIZE + sizeof(u32) + bufsize);
|
||||
@ -2872,7 +2872,7 @@ namespace rpcn
|
||||
return forge_send(command, packet_id, data);
|
||||
}
|
||||
|
||||
bool rpcn_client::forge_request_with_data(const std::string& serialized_data, CommandType command, u64 packet_id)
|
||||
bool rpcn_client::forge_request_with_data(std::string_view serialized_data, CommandType command, u64 packet_id)
|
||||
{
|
||||
const usz bufsize = serialized_data.size();
|
||||
std::vector<u8> data(sizeof(u32) + bufsize);
|
||||
@ -2897,14 +2897,14 @@ namespace rpcn
|
||||
return packet;
|
||||
}
|
||||
|
||||
bool rpcn_client::error_and_disconnect(const std::string& error_msg)
|
||||
bool rpcn_client::error_and_disconnect(std::string_view error_msg)
|
||||
{
|
||||
connected = false;
|
||||
rpcn_log.error("%s", error_msg);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool rpcn_client::error_and_disconnect_notice(const std::string& error_msg)
|
||||
bool rpcn_client::error_and_disconnect_notice(std::string_view error_msg)
|
||||
{
|
||||
connected = false;
|
||||
rpcn_log.notice("%s", error_msg);
|
||||
|
||||
@ -166,7 +166,7 @@ public:
|
||||
vec.push_back(*(reinterpret_cast<u8*>(&value) + index));
|
||||
}
|
||||
}
|
||||
void insert_string(const std::string& str) const
|
||||
void insert_string(std::string_view str) const
|
||||
{
|
||||
std::copy(str.begin(), str.end(), std::back_inserter(vec));
|
||||
vec.push_back(0);
|
||||
@ -277,8 +277,8 @@ namespace rpcn
|
||||
bool send_packet(const std::vector<u8>& packet);
|
||||
|
||||
private:
|
||||
bool connect(const std::string& host);
|
||||
bool login(const std::string& npid, const std::string& password, const std::string& token);
|
||||
bool connect(std::string_view host);
|
||||
bool login(std::string_view npid, std::string_view password, std::string_view token);
|
||||
void disconnect();
|
||||
|
||||
public:
|
||||
@ -297,12 +297,12 @@ namespace rpcn
|
||||
void remove_friend_cb(friend_cb_func, void* cb_param);
|
||||
|
||||
ErrorType create_user(std::string_view npid, std::string_view password, std::string_view online_name, std::string_view avatar_url, std::string_view email);
|
||||
ErrorType resend_token(const std::string& npid, const std::string& password);
|
||||
ErrorType resend_token(std::string_view npid, std::string_view password);
|
||||
ErrorType send_reset_token(std::string_view npid, std::string_view email);
|
||||
ErrorType reset_password(std::string_view npid, std::string_view token, std::string_view password);
|
||||
ErrorType delete_account();
|
||||
std::optional<ErrorType> add_friend(const std::string& friend_username);
|
||||
bool remove_friend(const std::string& friend_username);
|
||||
std::optional<ErrorType> add_friend(std::string_view friend_username);
|
||||
bool remove_friend(std::string_view friend_username);
|
||||
|
||||
u32 get_num_friends() const;
|
||||
u32 get_num_blocks() const;
|
||||
@ -346,8 +346,8 @@ namespace rpcn
|
||||
bool set_userinfo(u32 req_id, const SceNpCommunicationId& communication_id, const SceNpMatching2SetUserInfoRequest* req);
|
||||
bool ping_room_owner(u32 req_id, const SceNpCommunicationId& communication_id, u64 room_id);
|
||||
bool send_room_message(u32 req_id, const SceNpCommunicationId& communication_id, const SceNpMatching2SendRoomMessageRequest* req);
|
||||
bool req_sign_infos(u32 req_id, const std::string& npid);
|
||||
bool req_ticket(u32 req_id, const std::string& service_id, const std::vector<u8>& cookie);
|
||||
bool req_sign_infos(u32 req_id, std::string_view npid);
|
||||
bool req_ticket(u32 req_id, std::string_view service_id, const std::vector<u8>& cookie);
|
||||
bool send_message(const message_data& msg_data, const std::set<std::string>& npids);
|
||||
bool get_board_infos(u32 req_id, const SceNpCommunicationId& communication_id, SceNpScoreBoardId board_id);
|
||||
bool record_score(u32 req_id, const SceNpCommunicationId& communication_id, SceNpScoreBoardId board_id, SceNpScorePcId char_id, SceNpScoreValue score, const std::optional<std::string> comment, const std::optional<std::vector<u8>> score_data);
|
||||
@ -396,12 +396,12 @@ namespace rpcn
|
||||
|
||||
std::vector<u8> forge_request(rpcn::CommandType command, u64 packet_id, const std::vector<u8>& data) const;
|
||||
bool forge_send(rpcn::CommandType command, u64 packet_id, const std::vector<u8>& data);
|
||||
bool forge_request_with_com_id(const std::string& serialized_data, const SceNpCommunicationId& com_id, CommandType command, u64 packet_id);
|
||||
bool forge_request_with_data(const std::string& serialized_data, CommandType command, u64 packet_id);
|
||||
bool forge_request_with_com_id(std::string_view serialized_data, const SceNpCommunicationId& com_id, CommandType command, u64 packet_id);
|
||||
bool forge_request_with_data(std::string_view serialized_data, CommandType command, u64 packet_id);
|
||||
bool forge_send_reply(rpcn::CommandType command, u64 packet_id, const std::vector<u8>& data, std::vector<u8>& reply_data);
|
||||
|
||||
bool error_and_disconnect(const std::string& error_mgs);
|
||||
bool error_and_disconnect_notice(const std::string& error_msg);
|
||||
bool error_and_disconnect(std::string_view error_mgs);
|
||||
bool error_and_disconnect_notice(std::string_view error_msg);
|
||||
|
||||
std::string get_wolfssl_error(WOLFSSL* wssl, int error) const;
|
||||
|
||||
|
||||
@ -119,13 +119,14 @@ void upnp_handler::add_port_redir(const std::string& addr, u16 internal_port, st
|
||||
if (!m_active)
|
||||
return;
|
||||
|
||||
const std::string protocol_str(protocol);
|
||||
|
||||
std::lock_guard lock(m_mutex);
|
||||
|
||||
if (m_bindings[std::string(protocol)].contains(internal_port))
|
||||
if (m_bindings[protocol_str].contains(internal_port))
|
||||
return;
|
||||
|
||||
const std::string internal_port_str = fmt::format("%d", internal_port);
|
||||
const std::string protocol_str(protocol);
|
||||
const u32 max_port = std::min(static_cast<u32>(internal_port) + 100, 0xFFFFu);
|
||||
int res = 0;
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@ std::string GLFragmentDecompilerThread::getFunction(FUNCTION f)
|
||||
return glsl::getFunctionImpl(f);
|
||||
}
|
||||
|
||||
std::string GLFragmentDecompilerThread::compareFunction(COMPARE f, const std::string &Op0, const std::string &Op1)
|
||||
std::string GLFragmentDecompilerThread::compareFunction(COMPARE f, std::string_view Op0, std::string_view Op1)
|
||||
{
|
||||
return glsl::compareFunctionImpl(f, Op0, Op1);
|
||||
}
|
||||
|
||||
@ -34,8 +34,8 @@ public:
|
||||
protected:
|
||||
std::string getFloatTypeName(usz elementCount) override;
|
||||
std::string getHalfTypeName(usz elementCount) override;
|
||||
std::string getFunction(FUNCTION) override;
|
||||
std::string compareFunction(COMPARE, const std::string&, const std::string&) override;
|
||||
std::string getFunction(FUNCTION f) override;
|
||||
std::string compareFunction(COMPARE f, std::string_view Op0, std::string_view Op1) override;
|
||||
|
||||
void insertHeader(std::stringstream &OS) override;
|
||||
void insertInputs(std::stringstream &OS) override;
|
||||
|
||||
@ -21,12 +21,12 @@ std::string GLVertexDecompilerThread::getFunction(FUNCTION f)
|
||||
return glsl::getFunctionImpl(f);
|
||||
}
|
||||
|
||||
std::string GLVertexDecompilerThread::compareFunction(COMPARE f, const std::string &Op0, const std::string &Op1, bool scalar)
|
||||
std::string GLVertexDecompilerThread::compareFunction(COMPARE f, std::string_view Op0, std::string_view Op1, bool scalar)
|
||||
{
|
||||
return glsl::compareFunctionImpl(f, Op0, Op1, scalar);
|
||||
}
|
||||
|
||||
void GLVertexDecompilerThread::insertHeader(std::stringstream &OS)
|
||||
void GLVertexDecompilerThread::insertHeader(std::stringstream& OS)
|
||||
{
|
||||
OS <<
|
||||
"#version 430\n"
|
||||
@ -162,7 +162,7 @@ void GLVertexDecompilerThread::insertOutputs(std::stringstream& OS, const std::v
|
||||
}
|
||||
}
|
||||
|
||||
void GLVertexDecompilerThread::insertMainStart(std::stringstream & OS)
|
||||
void GLVertexDecompilerThread::insertMainStart(std::stringstream& OS)
|
||||
{
|
||||
const auto& dev_caps = gl::get_driver_caps();
|
||||
|
||||
@ -236,7 +236,7 @@ void GLVertexDecompilerThread::insertMainStart(std::stringstream & OS)
|
||||
}
|
||||
}
|
||||
|
||||
void GLVertexDecompilerThread::insertMainEnd(std::stringstream & OS)
|
||||
void GLVertexDecompilerThread::insertMainEnd(std::stringstream& OS)
|
||||
{
|
||||
OS << "}\n\n";
|
||||
|
||||
|
||||
@ -26,20 +26,20 @@ struct GLVertexDecompilerThread : public VertexProgramDecompiler
|
||||
protected:
|
||||
std::string getFloatTypeName(usz elementCount) override;
|
||||
std::string getIntTypeName(usz elementCount) override;
|
||||
std::string getFunction(FUNCTION) override;
|
||||
std::string compareFunction(COMPARE, const std::string&, const std::string&, bool scalar) override;
|
||||
std::string getFunction(FUNCTION f) override;
|
||||
std::string compareFunction(COMPARE f, std::string_view Op0, std::string_view Op1, bool scalar) override;
|
||||
|
||||
void insertHeader(std::stringstream &OS) override;
|
||||
void insertInputs(std::stringstream &OS, const std::vector<ParamType> &inputs) override;
|
||||
void insertConstants(std::stringstream &OS, const std::vector<ParamType> &constants) override;
|
||||
void insertOutputs(std::stringstream &OS, const std::vector<ParamType> &outputs) override;
|
||||
void insertMainStart(std::stringstream &OS) override;
|
||||
void insertMainEnd(std::stringstream &OS) override;
|
||||
void insertHeader(std::stringstream& OS) override;
|
||||
void insertInputs(std::stringstream& OS, const std::vector<ParamType>& inputs) override;
|
||||
void insertConstants(std::stringstream& OS, const std::vector<ParamType>& constants) override;
|
||||
void insertOutputs(std::stringstream& OS, const std::vector<ParamType>& outputs) override;
|
||||
void insertMainStart(std::stringstream& OS) override;
|
||||
void insertMainEnd(std::stringstream& OS) override;
|
||||
|
||||
const RSXVertexProgram &rsx_vertex_program;
|
||||
std::unordered_map<std::string, int> input_locations;
|
||||
public:
|
||||
GLVertexDecompilerThread(const RSXVertexProgram &prog, std::string& shader, ParamArray&)
|
||||
GLVertexDecompilerThread(const RSXVertexProgram& prog, std::string& shader, ParamArray&)
|
||||
: VertexProgramDecompiler(prog)
|
||||
, m_shader(shader)
|
||||
, rsx_vertex_program(prog)
|
||||
|
||||
@ -111,33 +111,33 @@ protected:
|
||||
/** returns string calling function where arguments are passed via
|
||||
* $0 $1 $2 substring.
|
||||
*/
|
||||
virtual std::string getFunction(FUNCTION) = 0;
|
||||
virtual std::string getFunction(FUNCTION f) = 0;
|
||||
|
||||
/** returns string calling comparison function on 2 args passed as strings.
|
||||
*/
|
||||
virtual std::string compareFunction(COMPARE, const std::string &, const std::string &) = 0;
|
||||
virtual std::string compareFunction(COMPARE f, std::string_view Op0, std::string_view Op1) = 0;
|
||||
|
||||
/** Insert header of shader file (eg #version, "system constants"...)
|
||||
*/
|
||||
virtual void insertHeader(std::stringstream &OS) = 0;
|
||||
virtual void insertHeader(std::stringstream& OS) = 0;
|
||||
/** Insert global declaration of fragments inputs.
|
||||
*/
|
||||
virtual void insertInputs(std::stringstream &OS) = 0;
|
||||
virtual void insertInputs(std::stringstream& OS) = 0;
|
||||
/** insert global declaration of fragments outputs.
|
||||
*/
|
||||
virtual void insertOutputs(std::stringstream &OS) = 0;
|
||||
virtual void insertOutputs(std::stringstream& OS) = 0;
|
||||
/** insert declaration of shader constants.
|
||||
*/
|
||||
virtual void insertConstants(std::stringstream &OS) = 0;
|
||||
virtual void insertConstants(std::stringstream& OS) = 0;
|
||||
/** insert helper function definitions.
|
||||
*/
|
||||
virtual void insertGlobalFunctions(std::stringstream &OS) = 0;
|
||||
virtual void insertGlobalFunctions(std::stringstream& OS) = 0;
|
||||
/** insert beginning of main (signature, temporary declaration...)
|
||||
*/
|
||||
virtual void insertMainStart(std::stringstream &OS) = 0;
|
||||
virtual void insertMainStart(std::stringstream& OS) = 0;
|
||||
/** insert end of main function (return value, output copy...)
|
||||
*/
|
||||
virtual void insertMainEnd(std::stringstream &OS) = 0;
|
||||
virtual void insertMainEnd(std::stringstream& OS) = 0;
|
||||
|
||||
public:
|
||||
enum : u16
|
||||
@ -201,7 +201,7 @@ public:
|
||||
device_props;
|
||||
|
||||
ParamArray m_parr;
|
||||
FragmentProgramDecompiler(const RSXFragmentProgram &prog, u32& size);
|
||||
FragmentProgramDecompiler(const RSXFragmentProgram& prog, u32& size);
|
||||
FragmentProgramDecompiler(const FragmentProgramDecompiler&) = delete;
|
||||
FragmentProgramDecompiler(FragmentProgramDecompiler&&) = delete;
|
||||
std::string Decompile();
|
||||
|
||||
@ -73,7 +73,7 @@ namespace glsl
|
||||
}
|
||||
}
|
||||
|
||||
std::string compareFunctionImpl(COMPARE f, const std::string &Op0, const std::string &Op1, bool scalar)
|
||||
std::string compareFunctionImpl(COMPARE f, std::string_view Op0, std::string_view Op1, bool scalar)
|
||||
{
|
||||
if (scalar)
|
||||
{
|
||||
|
||||
@ -71,7 +71,7 @@ namespace glsl
|
||||
|
||||
std::string getFloatTypeNameImpl(usz elementCount);
|
||||
std::string getHalfTypeNameImpl(usz elementCount);
|
||||
std::string compareFunctionImpl(COMPARE f, const std::string &Op0, const std::string &Op1, bool scalar = false);
|
||||
std::string compareFunctionImpl(COMPARE f, std::string_view Op0, std::string_view Op1, bool scalar = false);
|
||||
void insert_vertex_input_fetch(std::stringstream& OS, glsl_rules rules, bool glsl4_compliant=true);
|
||||
void insert_rop_init(std::ostream& OS);
|
||||
void insert_rop(std::ostream& OS, const shader_properties& props);
|
||||
|
||||
@ -130,7 +130,7 @@ struct ParamType
|
||||
{
|
||||
}
|
||||
|
||||
bool HasItem(const std::string& name) const
|
||||
bool HasItem(std::string_view name) const
|
||||
{
|
||||
return std::any_of(items.cbegin(), items.cend(), [&name](const auto& item)
|
||||
{
|
||||
@ -138,7 +138,7 @@ struct ParamType
|
||||
});
|
||||
}
|
||||
|
||||
bool ReplaceOrInsert(const std::string& name, const ParamItem& item)
|
||||
bool ReplaceOrInsert(std::string_view name, const ParamItem& item)
|
||||
{
|
||||
if (HasItem(name))
|
||||
{
|
||||
@ -168,7 +168,7 @@ struct ParamArray
|
||||
{
|
||||
std::vector<ParamType> params[PF_PARAM_COUNT];
|
||||
|
||||
ParamType* SearchParam(const ParamFlag &flag, const std::string& type)
|
||||
ParamType* SearchParam(const ParamFlag& flag, std::string_view type)
|
||||
{
|
||||
for (auto& param : params[flag])
|
||||
{
|
||||
@ -179,7 +179,7 @@ struct ParamArray
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool HasParamTypeless(const ParamFlag flag, const std::string& name) const
|
||||
bool HasParamTypeless(const ParamFlag flag, std::string_view name) const
|
||||
{
|
||||
const auto& p = params[flag];
|
||||
return std::any_of(p.cbegin(), p.cend(), [&name](const auto& param)
|
||||
@ -188,7 +188,7 @@ struct ParamArray
|
||||
});
|
||||
}
|
||||
|
||||
bool HasParam(const ParamFlag flag, const std::string& type, const std::string& name)
|
||||
bool HasParam(const ParamFlag flag, std::string_view type, std::string_view name)
|
||||
{
|
||||
const ParamType* t = SearchParam(flag, type);
|
||||
return t && t->HasItem(name);
|
||||
|
||||
@ -99,35 +99,35 @@ protected:
|
||||
/** returns string calling function where arguments are passed via
|
||||
* $0 $1 $2 substring.
|
||||
*/
|
||||
virtual std::string getFunction(FUNCTION) = 0;
|
||||
virtual std::string getFunction(FUNCTION f) = 0;
|
||||
|
||||
/** returns string calling comparison function on 2 args passed as strings.
|
||||
*/
|
||||
virtual std::string compareFunction(COMPARE, const std::string &, const std::string &, bool scalar = false) = 0;
|
||||
virtual std::string compareFunction(COMPARE f, std::string_view Op0, std::string_view Op1, bool scalar = false) = 0;
|
||||
|
||||
/** Insert header of shader file (eg #version, "system constants"...)
|
||||
*/
|
||||
virtual void insertHeader(std::stringstream &OS) = 0;
|
||||
virtual void insertHeader(std::stringstream& OS) = 0;
|
||||
|
||||
/** Insert vertex declaration.
|
||||
*/
|
||||
virtual void insertInputs(std::stringstream &OS, const std::vector<ParamType> &inputs) = 0;
|
||||
virtual void insertInputs(std::stringstream& OS, const std::vector<ParamType>& inputs) = 0;
|
||||
|
||||
/** insert global declaration of vertex shader outputs.
|
||||
*/
|
||||
virtual void insertConstants(std::stringstream &OS, const std::vector<ParamType> &constants) = 0;
|
||||
virtual void insertConstants(std::stringstream& OS, const std::vector<ParamType>& constants) = 0;
|
||||
|
||||
/** insert declaration of shader constants.
|
||||
*/
|
||||
virtual void insertOutputs(std::stringstream &OS, const std::vector<ParamType> &outputs) = 0;
|
||||
virtual void insertOutputs(std::stringstream& OS, const std::vector<ParamType>& outputs) = 0;
|
||||
|
||||
/** insert beginning of main (signature, temporary declaration...)
|
||||
*/
|
||||
virtual void insertMainStart(std::stringstream &OS) = 0;
|
||||
virtual void insertMainStart(std::stringstream& OS) = 0;
|
||||
|
||||
/** insert end of main function (return value, output copy...)
|
||||
*/
|
||||
virtual void insertMainEnd(std::stringstream &OS) = 0;
|
||||
virtual void insertMainEnd(std::stringstream& OS) = 0;
|
||||
|
||||
public:
|
||||
struct
|
||||
|
||||
@ -21,7 +21,7 @@ std::string VKFragmentDecompilerThread::getFunction(FUNCTION f)
|
||||
return glsl::getFunctionImpl(f);
|
||||
}
|
||||
|
||||
std::string VKFragmentDecompilerThread::compareFunction(COMPARE f, const std::string &Op0, const std::string &Op1)
|
||||
std::string VKFragmentDecompilerThread::compareFunction(COMPARE f, std::string_view Op0, std::string_view Op1)
|
||||
{
|
||||
return glsl::compareFunctionImpl(f, Op0, Op1);
|
||||
}
|
||||
|
||||
@ -37,8 +37,8 @@ public:
|
||||
protected:
|
||||
std::string getFloatTypeName(usz elementCount) override;
|
||||
std::string getHalfTypeName(usz elementCount) override;
|
||||
std::string getFunction(FUNCTION) override;
|
||||
std::string compareFunction(COMPARE, const std::string&, const std::string&) override;
|
||||
std::string getFunction(FUNCTION f) override;
|
||||
std::string compareFunction(COMPARE f, std::string_view Op0, std::string_view Op1) override;
|
||||
|
||||
void insertHeader(std::stringstream &OS) override;
|
||||
void insertInputs(std::stringstream &OS) override;
|
||||
|
||||
@ -282,7 +282,7 @@ namespace vk
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool program::has_uniform(program_input_type type, const std::string& uniform_name)
|
||||
bool program::has_uniform(program_input_type type, std::string_view uniform_name)
|
||||
{
|
||||
for (auto& set : m_sets)
|
||||
{
|
||||
@ -296,7 +296,7 @@ namespace vk
|
||||
return false;
|
||||
}
|
||||
|
||||
std::pair<u32, u32> program::get_uniform_location(::glsl::program_domain domain, program_input_type type, const std::string& uniform_name)
|
||||
std::pair<u32, u32> program::get_uniform_location(::glsl::program_domain domain, program_input_type type, std::string_view uniform_name)
|
||||
{
|
||||
for (unsigned i = 0; i < ::size32(m_sets); ++i)
|
||||
{
|
||||
@ -632,7 +632,7 @@ namespace vk
|
||||
|
||||
std::unordered_map<u32, VkDescriptorType> descriptor_type_map;
|
||||
|
||||
auto descriptor_count = [](const std::string& name) -> u32
|
||||
auto descriptor_count = [](std::string_view name) -> u32
|
||||
{
|
||||
const auto start = name.find_last_of("[");
|
||||
if (start == std::string::npos)
|
||||
@ -643,8 +643,8 @@ namespace vk
|
||||
const auto end = name.find_last_of("]");
|
||||
ensure(end != std::string::npos && start < end, "Invalid variable name");
|
||||
|
||||
const std::string array_size = name.substr(start + 1, end - start - 1);
|
||||
if (const auto count = std::atoi(array_size.c_str());
|
||||
const std::string_view array_size = name.substr(start + 1, end - start - 1);
|
||||
if (const auto count = std::atoi(array_size.data());
|
||||
count > 0)
|
||||
{
|
||||
return count;
|
||||
|
||||
@ -221,13 +221,12 @@ namespace vk
|
||||
program& link(bool separate_stages);
|
||||
program& bind(const vk::command_buffer& cmd, VkPipelineBindPoint bind_point);
|
||||
|
||||
bool has_uniform(program_input_type type, const std::string &uniform_name);
|
||||
std::pair<u32, u32> get_uniform_location(::glsl::program_domain domain, program_input_type type, const std::string& uniform_name);
|
||||
bool has_uniform(program_input_type type, std::string_view uniform_name);
|
||||
std::pair<u32, u32> get_uniform_location(::glsl::program_domain domain, program_input_type type, std::string_view uniform_name);
|
||||
|
||||
void bind_uniform(const VkDescriptorImageInfoEx& image_descriptor, u32 set_id, u32 binding_point);
|
||||
void bind_uniform(const VkDescriptorBufferInfoEx& buffer_descriptor, u32 set_id, u32 binding_point);
|
||||
void bind_uniform(const VkDescriptorBufferViewEx& buffer_view, u32 set_id, u32 binding_point);
|
||||
void bind_uniform(const VkDescriptorBufferViewEx& buffer_view, ::glsl::program_domain domain, program_input_type type, const std::string &binding_name);
|
||||
|
||||
void bind_uniform_array(const std::span<const VkDescriptorImageInfoEx>& image_descriptors,u32 set_id, u32 binding_point);
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@ std::string VKVertexDecompilerThread::getFunction(FUNCTION f)
|
||||
return glsl::getFunctionImpl(f);
|
||||
}
|
||||
|
||||
std::string VKVertexDecompilerThread::compareFunction(COMPARE f, const std::string &Op0, const std::string &Op1, bool scalar)
|
||||
std::string VKVertexDecompilerThread::compareFunction(COMPARE f, std::string_view Op0, std::string_view Op1, bool scalar)
|
||||
{
|
||||
return glsl::compareFunctionImpl(f, Op0, Op1, scalar);
|
||||
}
|
||||
@ -69,7 +69,7 @@ void VKVertexDecompilerThread::prepareBindingTable()
|
||||
}
|
||||
}
|
||||
|
||||
void VKVertexDecompilerThread::insertHeader(std::stringstream &OS)
|
||||
void VKVertexDecompilerThread::insertHeader(std::stringstream& OS)
|
||||
{
|
||||
prepareBindingTable();
|
||||
|
||||
@ -182,7 +182,7 @@ void VKVertexDecompilerThread::insertInputs(std::stringstream& OS, const std::ve
|
||||
}
|
||||
}
|
||||
|
||||
void VKVertexDecompilerThread::insertConstants(std::stringstream & OS, const std::vector<ParamType> & constants)
|
||||
void VKVertexDecompilerThread::insertConstants(std::stringstream& OS, const std::vector<ParamType>& constants)
|
||||
{
|
||||
vk::glsl::program_input in
|
||||
{
|
||||
@ -330,7 +330,7 @@ void VKVertexDecompilerThread::insertFSExport(std::stringstream& OS)
|
||||
"}\n\n";
|
||||
}
|
||||
|
||||
void VKVertexDecompilerThread::insertMainStart(std::stringstream & OS)
|
||||
void VKVertexDecompilerThread::insertMainStart(std::stringstream& OS)
|
||||
{
|
||||
glsl::shader_properties properties2{};
|
||||
properties2.domain = glsl::glsl_vertex_program;
|
||||
@ -388,9 +388,9 @@ void VKVertexDecompilerThread::insertMainStart(std::stringstream & OS)
|
||||
OS << "{\n";
|
||||
|
||||
//Declare temporary registers, ignoring those mapped to outputs
|
||||
for (const ParamType &PT : m_parr.params[PF_PARAM_NONE])
|
||||
for (const ParamType& PT : m_parr.params[PF_PARAM_NONE])
|
||||
{
|
||||
for (const ParamItem &PI : PT.items)
|
||||
for (const ParamItem& PI : PT.items)
|
||||
{
|
||||
if (PI.name.starts_with("dst_reg"))
|
||||
continue;
|
||||
@ -403,9 +403,9 @@ void VKVertexDecompilerThread::insertMainStart(std::stringstream & OS)
|
||||
}
|
||||
}
|
||||
|
||||
for (const ParamType &PT : m_parr.params[PF_PARAM_IN])
|
||||
for (const ParamType& PT : m_parr.params[PF_PARAM_IN])
|
||||
{
|
||||
for (const ParamItem &PI : PT.items)
|
||||
for (const ParamItem& PI : PT.items)
|
||||
{
|
||||
OS << " vec4 " << PI.name << "= read_location(" << std::to_string(PI.location) << ");\n";
|
||||
}
|
||||
@ -414,7 +414,7 @@ void VKVertexDecompilerThread::insertMainStart(std::stringstream & OS)
|
||||
OS << "\nuint xform_constants_offset = get_draw_params().xform_constants_offset;\n\n";
|
||||
}
|
||||
|
||||
void VKVertexDecompilerThread::insertMainEnd(std::stringstream & OS)
|
||||
void VKVertexDecompilerThread::insertMainEnd(std::stringstream& OS)
|
||||
{
|
||||
OS << "}\n\n";
|
||||
|
||||
|
||||
@ -25,21 +25,21 @@ struct VKVertexDecompilerThread : public VertexProgramDecompiler
|
||||
protected:
|
||||
std::string getFloatTypeName(usz elementCount) override;
|
||||
std::string getIntTypeName(usz elementCount) override;
|
||||
std::string getFunction(FUNCTION) override;
|
||||
std::string compareFunction(COMPARE, const std::string&, const std::string&, bool scalar) override;
|
||||
std::string getFunction(FUNCTION f) override;
|
||||
std::string compareFunction(COMPARE f, std::string_view Op0, std::string_view Op1, bool scalar) override;
|
||||
|
||||
void insertHeader(std::stringstream &OS) override;
|
||||
void insertInputs(std::stringstream &OS, const std::vector<ParamType> &inputs) override;
|
||||
void insertConstants(std::stringstream &OS, const std::vector<ParamType> &constants) override;
|
||||
void insertOutputs(std::stringstream &OS, const std::vector<ParamType> &outputs) override;
|
||||
void insertMainStart(std::stringstream &OS) override;
|
||||
void insertMainEnd(std::stringstream &OS) override;
|
||||
void insertHeader(std::stringstream& OS) override;
|
||||
void insertInputs(std::stringstream& OS, const std::vector<ParamType>& inputs) override;
|
||||
void insertConstants(std::stringstream& OS, const std::vector<ParamType>& constants) override;
|
||||
void insertOutputs(std::stringstream& OS, const std::vector<ParamType>& outputs) override;
|
||||
void insertMainStart(std::stringstream& OS) override;
|
||||
void insertMainEnd(std::stringstream& OS) override;
|
||||
|
||||
void prepareBindingTable();
|
||||
|
||||
const RSXVertexProgram &rsx_vertex_program;
|
||||
public:
|
||||
VKVertexDecompilerThread(const RSXVertexProgram &prog, std::string& shader, ParamArray&, class VKVertexProgram &dst)
|
||||
VKVertexDecompilerThread(const RSXVertexProgram& prog, std::string& shader, ParamArray&, class VKVertexProgram& dst)
|
||||
: VertexProgramDecompiler(prog)
|
||||
, m_shader(shader)
|
||||
, vk_prog(&dst)
|
||||
|
||||
@ -4276,10 +4276,12 @@ std::set<std::string> Emulator::GetGameDirs() const
|
||||
return dirs;
|
||||
}
|
||||
|
||||
u32 Emulator::AddGamesFromDir(const std::string& path)
|
||||
u32 Emulator::AddGamesFromDir(std::string path)
|
||||
{
|
||||
u32 games_added = 0;
|
||||
|
||||
fmt::trim_back(path, fs::delim);
|
||||
|
||||
m_games_config.set_save_on_dirty(false);
|
||||
|
||||
// search for a game on the provided path first (game on ISO file or on folder type)
|
||||
@ -4313,7 +4315,7 @@ u32 Emulator::AddGamesFromDir(const std::string& path)
|
||||
continue;
|
||||
}
|
||||
|
||||
const std::string dir_path = path + '/' + dir_entry.name;
|
||||
const std::string dir_path = path + "/" + dir_entry.name;
|
||||
|
||||
if (!dir_entry.is_directory && !is_iso_file(dir_path))
|
||||
{
|
||||
@ -4349,8 +4351,10 @@ u32 Emulator::AddGamesFromDir(const std::string& path)
|
||||
return games_added;
|
||||
}
|
||||
|
||||
game_boot_result Emulator::AddGame(const std::string& path)
|
||||
game_boot_result Emulator::AddGame(std::string path)
|
||||
{
|
||||
fmt::trim_back(path, fs::delim);
|
||||
|
||||
// Handle files directly
|
||||
if (!fs::is_dir(path) || fs::get_optical_raw_device(path))
|
||||
{
|
||||
@ -4396,8 +4400,10 @@ game_boot_result Emulator::AddGame(const std::string& path)
|
||||
return result;
|
||||
}
|
||||
|
||||
game_boot_result Emulator::AddGameToYml(const std::string& path)
|
||||
game_boot_result Emulator::AddGameToYml(std::string path)
|
||||
{
|
||||
fmt::trim_back(path, fs::delim);
|
||||
|
||||
// Detect boot location
|
||||
const auto is_invalid_path = [this](std::string_view path, std::string_view dir) -> game_boot_result
|
||||
{
|
||||
@ -4843,7 +4849,7 @@ bool Emulator::IsValidSfb(const std::string& path)
|
||||
return false;
|
||||
}
|
||||
|
||||
void Emulator::SaveSettings(const std::string& settings, const std::string& title_id)
|
||||
void Emulator::SaveSettings(std::string_view settings, const std::string& title_id)
|
||||
{
|
||||
std::string config_name;
|
||||
|
||||
@ -4864,7 +4870,7 @@ void Emulator::SaveSettings(const std::string& settings, const std::string& titl
|
||||
}
|
||||
else
|
||||
{
|
||||
temp.file.write(settings.c_str(), settings.size());
|
||||
temp.file.write(settings.data(), settings.size());
|
||||
if (!temp.commit())
|
||||
{
|
||||
sys_log.error("Could not save config to %s (failed to commit) (error=%s)", config_name, fs::g_tls_error);
|
||||
@ -4875,7 +4881,7 @@ void Emulator::SaveSettings(const std::string& settings, const std::string& titl
|
||||
if (config_name == g_cfg.name || title_id == Emu.GetTitleID())
|
||||
{
|
||||
// Update current config
|
||||
if (!g_cfg.from_string({settings.c_str(), settings.size()}, !Emu.IsStopped()))
|
||||
if (!g_cfg.from_string(settings, !Emu.IsStopped()))
|
||||
{
|
||||
sys_log.fatal("Failed to update configuration");
|
||||
}
|
||||
|
||||
@ -489,9 +489,9 @@ public:
|
||||
void ConfigurePPUCache() const;
|
||||
|
||||
std::set<std::string> GetGameDirs() const;
|
||||
u32 AddGamesFromDir(const std::string& path);
|
||||
game_boot_result AddGame(const std::string& path);
|
||||
game_boot_result AddGameToYml(const std::string& path);
|
||||
u32 AddGamesFromDir(std::string path);
|
||||
game_boot_result AddGame(std::string path);
|
||||
game_boot_result AddGameToYml(std::string path);
|
||||
u32 RemoveGamesFromDir(const std::string& games_dir, const std::vector<std::string>& serials_to_remove_from_yml = {}, bool save_on_disk = true);
|
||||
u32 RemoveGames(const std::vector<std::string>& title_id_list, bool save_on_disk = true);
|
||||
game_boot_result RemoveGameFromYml(const std::string& title_id);
|
||||
@ -510,7 +510,7 @@ public:
|
||||
static bool IsVsh();
|
||||
static bool IsValidSfb(const std::string& path);
|
||||
|
||||
static void SaveSettings(const std::string& settings, const std::string& title_id);
|
||||
static void SaveSettings(std::string_view settings, const std::string& title_id);
|
||||
};
|
||||
|
||||
extern Emulator Emu;
|
||||
|
||||
@ -56,13 +56,13 @@ namespace rpcs3::utils
|
||||
was_silenced = silenced;
|
||||
}
|
||||
|
||||
u32 check_user(const std::string& user)
|
||||
u32 check_user(std::string_view user)
|
||||
{
|
||||
u32 id = 0;
|
||||
|
||||
if (user.size() == 8)
|
||||
{
|
||||
std::from_chars(&user.front(), &user.back() + 1, id);
|
||||
std::from_chars(user.data(), user.data() + user.size(), id);
|
||||
}
|
||||
|
||||
return id;
|
||||
@ -583,7 +583,7 @@ namespace rpcs3::utils
|
||||
const bool check_disc = !disc_dir.empty();
|
||||
const bool check_hdd0 = !hdd0_dir.empty() && !check_disc;
|
||||
|
||||
const auto find_content = [&](const std::string& name, const std::string& extension) -> std::string
|
||||
const auto find_content = [&](std::string_view name, std::string_view extension) -> std::string
|
||||
{
|
||||
// Check localized content first
|
||||
for (bool localized : { true, false })
|
||||
|
||||
@ -21,7 +21,7 @@ namespace rpcs3::utils
|
||||
|
||||
void configure_logs(bool force_enable = false);
|
||||
|
||||
u32 check_user(const std::string& user);
|
||||
u32 check_user(std::string_view user);
|
||||
|
||||
bool install_pkg(const std::string& path);
|
||||
|
||||
|
||||
@ -11,9 +11,9 @@ std::string cfg_vfs::get(const cfg::string& _cfg, std::string_view emu_dir) cons
|
||||
return get(_cfg.to_string(), _cfg.def, emu_dir);
|
||||
}
|
||||
|
||||
std::string cfg_vfs::get(const std::string& _cfg, const std::string& def, std::string_view emu_dir) const
|
||||
std::string cfg_vfs::get(std::string_view _cfg, std::string_view def, std::string_view emu_dir) const
|
||||
{
|
||||
std::string path = _cfg;
|
||||
std::string path = std::string(_cfg);
|
||||
|
||||
// Fallback
|
||||
if (path.empty())
|
||||
|
||||
@ -42,7 +42,7 @@ struct cfg_vfs : cfg::node
|
||||
cfg::device_info get_device(const cfg::device_entry& _cfg, std::string_view key, std::string_view emu_dir = {}) const;
|
||||
|
||||
private:
|
||||
std::string get(const std::string& _cfg, const std::string& def, std::string_view emu_dir) const;
|
||||
std::string get(std::string_view _cfg, std::string_view def, std::string_view emu_dir) const;
|
||||
cfg::device_info get_device_info(const cfg::device_entry& _cfg, std::string_view key, std::string_view emu_dir = {}) const;
|
||||
};
|
||||
|
||||
|
||||
@ -195,7 +195,7 @@ bool cheat_engine::erase(const std::string& game, const u32 offset)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool cheat_engine::resolve_script(u32& final_offset, const u32 offset, const std::string& red_script)
|
||||
bool cheat_engine::resolve_script(u32& final_offset, const u32 offset, std::string_view red_script)
|
||||
{
|
||||
enum operand
|
||||
{
|
||||
@ -290,8 +290,11 @@ bool cheat_engine::resolve_script(u32& final_offset, const u32 offset, const std
|
||||
cur_op = operand_sub;
|
||||
index++;
|
||||
break;
|
||||
case ' ': index++; break;
|
||||
default: log_cheat.fatal("invalid character in redirection script"); return false;
|
||||
case ' ': index++;
|
||||
break;
|
||||
default:
|
||||
log_cheat.fatal("invalid character in redirection script");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@ public:
|
||||
void save() const;
|
||||
|
||||
// Static functions to find/get/set values in ps3 memory
|
||||
static bool resolve_script(u32& final_offset, const u32 offset, const std::string& red_script);
|
||||
static bool resolve_script(u32& final_offset, const u32 offset, std::string_view red_script);
|
||||
|
||||
template <typename T>
|
||||
static std::vector<u32> search(const T value, const std::vector<u32>& to_filter);
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
|
||||
LOG_CHANNEL(cfg_log, "CFG");
|
||||
|
||||
const auto midi_deleter = [](RtMidiWrapper* ptr) { if (ptr) rtmidi_in_free(ptr); };
|
||||
inline constexpr auto midi_deleter = [](RtMidiWrapper* ptr) { if (ptr) rtmidi_in_free(ptr); };
|
||||
using midi_ptr = std::unique_ptr<RtMidiWrapper, decltype(midi_deleter)>;
|
||||
|
||||
std::mutex midi_creator::m_midi_init_mutex = {};
|
||||
|
||||
@ -1353,7 +1353,7 @@ rpcn_friends_dialog::~rpcn_friends_dialog()
|
||||
}
|
||||
}
|
||||
|
||||
bool rpcn_friends_dialog::add_friend_with_error_dialog(const std::string& friend_username)
|
||||
bool rpcn_friends_dialog::add_friend_with_error_dialog(std::string_view friend_username)
|
||||
{
|
||||
QString err_msg;
|
||||
const auto opt_error = m_rpcn->add_friend(friend_username);
|
||||
|
||||
@ -121,7 +121,7 @@ public:
|
||||
private:
|
||||
void add_update_list(QListWidget* list, const QString& name, const QIcon& icon, const QVariant& data);
|
||||
void remove_list(QListWidget* list, const QString& name);
|
||||
bool add_friend_with_error_dialog(const std::string& friend_username);
|
||||
bool add_friend_with_error_dialog(std::string_view friend_username);
|
||||
|
||||
private Q_SLOTS:
|
||||
void add_update_friend(const QString& name, bool status);
|
||||
|
||||
@ -109,7 +109,7 @@ namespace gui::utils
|
||||
return true;
|
||||
}
|
||||
|
||||
static std::string make_simple_name(const std::string& name)
|
||||
static std::string make_simple_name(std::string_view name)
|
||||
{
|
||||
const std::string simple_name = QString::fromStdString(vfs::escape(name, true)).simplified().toStdString();
|
||||
return simple_name;
|
||||
@ -227,7 +227,7 @@ namespace gui::utils
|
||||
Microsoft::WRL::ComPtr<IShellLink> pShellLink;
|
||||
Microsoft::WRL::ComPtr<IPersistFile> pPersistFile;
|
||||
|
||||
const auto cleanup = [&](bool return_value, const std::string& fail_reason) -> bool
|
||||
const auto cleanup = [&](bool return_value, std::string_view fail_reason) -> bool
|
||||
{
|
||||
if (!return_value) sys_log.error("Failed to create shortcut: %s", fail_reason);
|
||||
CoUninitialize();
|
||||
@ -611,7 +611,7 @@ namespace gui::utils
|
||||
return result;
|
||||
}
|
||||
|
||||
static void remove_shortcuts(const std::string& simple_name, [[maybe_unused]] const std::string& serial)
|
||||
static void remove_shortcuts(std::string_view simple_name, [[maybe_unused]] const std::string& serial)
|
||||
{
|
||||
if (simple_name.empty() || simple_name == "." || simple_name == "..")
|
||||
{
|
||||
|
||||
@ -520,7 +520,7 @@ namespace gui::utils
|
||||
return !path.empty() && fs::is_dir(path);
|
||||
}
|
||||
|
||||
u32 steam_shortcut::crc32(const std::string& data)
|
||||
u32 steam_shortcut::crc32(std::string_view data)
|
||||
{
|
||||
u32 crc = 0xFFFFFFFF;
|
||||
|
||||
@ -882,7 +882,7 @@ namespace gui::utils
|
||||
}
|
||||
#endif
|
||||
|
||||
std::string steam_shortcut::steamid64_to_32(const std::string& steam_id)
|
||||
std::string steam_shortcut::steamid64_to_32(std::string_view steam_id)
|
||||
{
|
||||
u64 id = 0;
|
||||
if (!try_to_uint64(&id, steam_id, 0, umax))
|
||||
@ -1009,7 +1009,7 @@ namespace gui::utils
|
||||
|
||||
usz user_count = 0;
|
||||
|
||||
const auto find_user_id = [&content, &user_count](const std::string& key, const std::string& comp) -> std::string
|
||||
const auto find_user_id = [&content, &user_count](const std::string& key, std::string_view comp) -> std::string
|
||||
{
|
||||
user_count = 0;
|
||||
usz pos = 0;
|
||||
|
||||
@ -105,7 +105,7 @@ namespace gui::utils
|
||||
|
||||
void update_steam_input_config(const std::string& user_dir);
|
||||
|
||||
static u32 crc32(const std::string& data);
|
||||
static u32 crc32(std::string_view data);
|
||||
static u32 steam_appid(const std::string& exe, const std::string& name);
|
||||
|
||||
static void append(std::string& s, const std::string& val);
|
||||
@ -114,7 +114,7 @@ namespace gui::utils
|
||||
static std::string fix_slashes(const std::string& s);
|
||||
static std::string kv_string(const std::string& key, const std::string& value);
|
||||
static std::string kv_int(const std::string& key, u32 value);
|
||||
static std::string steamid64_to_32(const std::string& steam_id);
|
||||
static std::string steamid64_to_32(std::string_view steam_id);
|
||||
static std::string get_steam_path();
|
||||
static std::string get_last_active_steam_user(const std::string& steam_path);
|
||||
|
||||
|
||||
@ -229,7 +229,7 @@ void user_manager_dialog::OnUserRemove()
|
||||
}
|
||||
}
|
||||
|
||||
void user_manager_dialog::GenerateUser(const std::string& user_id, const std::string& username)
|
||||
void user_manager_dialog::GenerateUser(const std::string& user_id, std::string_view username)
|
||||
{
|
||||
ensure(rpcs3::utils::check_user(user_id) > 0);
|
||||
|
||||
|
||||
@ -35,7 +35,7 @@ protected:
|
||||
private:
|
||||
void Init();
|
||||
void UpdateTable(bool mark_only = false);
|
||||
static void GenerateUser(const std::string& user_id, const std::string& username);
|
||||
static void GenerateUser(const std::string& user_id, std::string_view username);
|
||||
static bool ValidateUsername(const QString& text_to_validate);
|
||||
|
||||
void ShowContextMenu(const QPoint &pos);
|
||||
|
||||
@ -51,7 +51,7 @@ namespace rsx::assembler
|
||||
return nullptr;
|
||||
};
|
||||
|
||||
static FlowGraph CFG_from_source(const std::string& asm_)
|
||||
static FlowGraph CFG_from_source(std::string_view asm_)
|
||||
{
|
||||
auto ir = FPIR::from_source(asm_);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user