-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStrCtrl.h
More file actions
67 lines (59 loc) · 1.84 KB
/
StrCtrl.h
File metadata and controls
67 lines (59 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#pragma once
#include <Windows.h>
#include <string>
#include <vector>
#include <cstdlib> // rand() 함수를 사용하기 위한 헤더 파일
#include <ctime> // 랜덤 시드를 설정하기 위한 헤더 파일
class CStrCtrl;
extern CStrCtrl StrCtrl;
class CStrCtrl
{
public:
CStrCtrl();
~CStrCtrl();
public:
/**
* Ansi 타입의 문자열을 Wide 타입의 문자열로 변환해주는 함수.
*
* \param str - Ansi 타입 문자열
* \return - Wide 타입 문자열
*/
std::wstring AnsiStringToWideString(std::string str);
/**
* Wide 타입의 문자열을 Ansi 타입의 문자열로 변환해주는 함수.
*
* \param str - Wide 타입 문자열
* \return - Ansi 타입 문자열
*/
std::string WideStringToAnsiString(std::wstring str);
/**
* UTF-8로 인코딩된 문자열을 UTF-16 인코딩으로 변환해주는 함수 .
*
* \param str - 변환하고자 하는 문자열
* \return
*/
std::wstring UTF8ToUTF16(const std::string& str);
/**
* UTF-16로 인코딩된 문자열을 UTF-8 인코딩으로 변환해주는 함수 .
*
* \param str - 변환하고자 하는 문자열
* \return
*/
std::string UTF16ToUTF8(const std::wstring& str);
/**
* @brief 문자열을 구분자로 나누어 벡터에 저장합니다.
*
* @param pString 구분할 문자열입니다.
* @param pDelimiter 구분자입니다.
* @param pVecString 문자열을 저장할 벡터입니다.
* @return int ERROR_SUCCESS : 성공적으로 처리되었습니다.
* @return int ERROR_INVALID_PARAMETER : 입력된 매개변수 중 하나 이상이 NULL입니다.
*/
int GetStringParsing(WCHAR* pString, WCHAR* pDelimiter, std::vector<std::wstring>* pVecString);
/**
* @brief 특정 길이의 랜덤 문자열을 만듭니다.
*
* @param length 원하는 길이
*/
std::string GetRandomString(int length);
};