/** mystrings.h
 * 汎用文字列処理関数など（ヘッダ部）
 *
 * @copyright	(c)studio pahoo
 * @author		パパぱふぅ
 * @動作環境	MinGW C++
 */
#ifndef MYSTRING_H
#define MYSTRING_H

#include <stdlib.h>
#include <tchar.h>
#include <string>
#include <vector>
#include <winsock2.h>
#include <windows.h>
#include <shlobj.h>

std::string getMyPath(const char* appname);
std::string getModulePath(void);

void setClipboardData(std::string str);
char* getClipboardData(void);

BOOL GetVersion2(OSVERSIONINFOEX* os);

void setStrEditBox(HWND hDlg, unsigned id, std::string s);

std::string getStrEditBox(HWND hDlg, unsigned id);

std::wstring __sjis_wstring(std::string src);
#define _SW(s)	__sjis_wstring(s)
std::string __wstring_sjis(std::wstring src);
#define _WS(s)	__wstring_sjis(s)
std::wstring __utf8_wstring(std::string src);
#define _UW(s)	__utf8_wstring(s)
std::string __wstring_utf8(std::wstring src);
#define _WU(s)	__wstring_utf8(s)
std::string sjis_utf8(std::string src);
#define _SU(s)	sjis_utf8(s)
std::string utf8_sjis(std::string src);
#define _US(s)	utf8_sjis(s)

std::wstring wconvString(std::wstring wsour, DWORD method);
double w2f(std::wstring sour);
std::wstring wstrip_tags(std::wstring html);
std::wstring wrepNL(std::wstring str, std::wstring rep);
std::vector<std::wstring> wsplit(const std::wstring src, const wchar_t delim);

std::wstring htmlspecialchars(std::wstring str);
std::string urlencode(std::wstring str);
bool readWebContents(const std::string url, const std::string ua, std::string* contents, int* httpStatus, char* post=NULL);

void getTempFname(char *tmpname);
void CenterWindow(HWND hDlg);

// char*バッファサイズ
#define SIZE_BUFF	512

#endif
