Skip to content

Commit

Permalink
[PC][windows] fix reference to 'byte' is ambiguous
Browse files Browse the repository at this point in the history
  • Loading branch information
a8jan committed Nov 11, 2023
1 parent 85e21af commit b2bf328
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions lib/EdUrlParser/EdUrlParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ void EdUrlParser::toHex(char* desthex, char c) {

// #prgamas are to ignore warnings about variables being set and not used
__BEGIN_IGNORE_UNUSEDVARS
int EdUrlParser::parsePath(vector<string>* folders, string pathstr) {
int EdUrlParser::parsePath(std::vector<string>* folders, string pathstr) {
int _url_errorno = 0;
int path_pos = 0;
size_t pos = 0;
Expand Down Expand Up @@ -216,11 +216,11 @@ bool EdUrlParser::toChar(const char* hex, char *result) {
return true;
}

size_t EdUrlParser::parseKeyValueMap(unordered_map<string, string> *kvmap, const string &rawstr, bool strict) {
size_t EdUrlParser::parseKeyValueMap(std::unordered_map<string, string> *kvmap, const string &rawstr, bool strict) {
return parseKeyValue(rawstr, __kv_callback_map, kvmap, strict);
}

size_t EdUrlParser::parseKeyValueList(vector< query_kv_t > *kvvec, const string &rawstr, bool strict) {
size_t EdUrlParser::parseKeyValueList(std::vector< query_kv_t > *kvvec, const string &rawstr, bool strict) {
return parseKeyValue(rawstr, __kv_callback_vec, kvvec, strict);
}

Expand Down Expand Up @@ -275,13 +275,13 @@ size_t EdUrlParser::parseKeyValue(const string &rawstr, __kv_callback kvcb, void


int __kv_callback_map(void* list, string k, string v) {
auto *map = (unordered_map<string, string>*)list;
auto *map = (std::unordered_map<string, string>*)list;
(*map)[k] = v;
return map->size();
}

int __kv_callback_vec(void* list, string k, string v) {
auto *vec = (vector<query_kv_t>*)list;
auto *vec = (std::vector<query_kv_t>*)list;
query_kv_t t ={k, v};
vec->push_back(t);
return vec->size();
Expand All @@ -290,4 +290,4 @@ int __kv_callback_vec(void* list, string k, string v) {
bool EdUrlParser::isValidUrl()
{
return !scheme.empty() && !(path.empty() && port.empty());
}
}
10 changes: 5 additions & 5 deletions lib/EdUrlParser/EdUrlParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <unordered_map>
#include <vector>

using namespace std;
using std::string;

typedef struct {
string key;
Expand All @@ -28,13 +28,13 @@ class EdUrlParser {
public:
virtual ~EdUrlParser();
static EdUrlParser* parseUrl(const string &urlstr);
static int parsePath(vector<string> *pdirlist, string pathstr);
static int parsePath(std::vector<string> *pdirlist, string pathstr);
static string urlDecode(const string &str);
static bool toChar(const char* hex, char *result);
static string urlEncode(const string &s);
static void toHex(char *desthex, char c);
static size_t parseKeyValueMap(unordered_map<string, string> *kvmap, const string &str, bool strict=true);
static size_t parseKeyValueList(vector< query_kv_t > *kvmap, const string &rawstr, bool strict=true);
static size_t parseKeyValueMap(std::unordered_map<string, string> *kvmap, const string &str, bool strict=true);
static size_t parseKeyValueList(std::vector< query_kv_t > *kvmap, const string &rawstr, bool strict=true);
static size_t parseKeyValue(const string &rawstr, __kv_callback kvcb, void* obj, bool strict);
bool isValidUrl();

Expand All @@ -52,4 +52,4 @@ class EdUrlParser {
string toString() { return scheme + "://" + hostName + (port.empty() ? "" : (":" + port)) + path + (query.empty() ? "" : "?" + query) + (fragment.empty() ? "" : "#" + fragment); }
};

#endif /* EDURLPARSER_H_ */
#endif /* EDURLPARSER_H_ */

0 comments on commit b2bf328

Please sign in to comment.