C++ FTP Stack
0.10
|
SIP stack 프로젝트에서 사용되는 OS independent 라이브러리 더 자세히 ...
클래스 | |
class | CDirectory |
디렉토리 관련 연산을 수행하는 클래스 더 자세히 ... | |
class | CFileLog |
파일 로그 저장 클래스 더 자세히 ... | |
class | ILogCallBack |
로그 메시지를 프로그램에서 처리하고 싶은 경우에 사용한다. 더 자세히 ... | |
class | CLog |
로그 관련 클래스 더 자세히 ... | |
class | CRandom |
random 번호 생성 클래스 더 자세히 ... | |
class | CSipMutex |
mutex 기능을 수행하는 클래스 더 자세히 ... | |
class | CSipMutexSignal |
mutex 기능 및 wait/signal 기능을 수행하는 클래스. 더 자세히 ... | |
class | CStringMap |
문자열 맵 자료구조 클래스 더 자세히 ... |
열거형 타입 | |
enum | EnumLogLevel { LOG_ERROR = 0x0001, LOG_INFO = 0x0010, LOG_DEBUG = 0x0100, LOG_NETWORK = 0x0200, LOG_SYSTEM = 0x400, LOG_SQL = 0x800 } |
로그 레벨 관련 ENUM CLog 에서 사용하는 ENUM 이다. 더 자세히 ... |
함수 | |
int | GetBase64EncodeLength (int iLength) |
plain text 를 base64 문자열로 변환하였을 때의 base64 문자열의 길이를 리턴한다. | |
int | GetBase64DecodeLength (int iLength) |
base64 문자열을 plain text 로 변환하였을 때에 plain text 의 길이를 리턴한다. | |
int | Base64Encode (const char *pszInput, int iInputLength, char *pszOutput, int iOutputLength) |
plain text 를 base64 문자열로 변환한다. | |
int | Base64Decode (const char *pszInput, int iInputLength, char *pszOutput, int iOutputLength) |
base64 문자열을 plain text 문자열로 변환한다. | |
bool | Base64Encode (const char *pszInput, int iInputLength, std::string &strOutput) |
plain text 를 base64 문자열로 변환한다. | |
bool | IsExistFile (const char *pszFileName) |
파일이 존재하는지 검사한다. | |
int64_t | GetFileSize (const char *pszFileName) |
파일 크기를 리턴한다. | |
bool | GetFileExt (const char *pszFileName, std::string &strExt) |
파일 이름에서 파일 확장자를 가져온다. | |
bool | GetFolderPathOfFilePath (const char *pszFilePath, std::string &strFolder) |
파일 경로에서 폴더 경로 가져오기 | |
bool | GetFileNameOfFilePath (const char *pszFilePath, std::string &strFileName) |
파일 경로에서 파일 이름 가져오기 | |
bool | GetFileDate (const char *pszFileName, std::string &strDate) |
파일의 수정 시간을 가져온다. | |
bool | SetFileDate (const char *pszFileName, const char *pszDate) |
파일의 수정 시간을 설정한다. | |
void | DelFile (const char *pszFileName) |
파일을 삭제한다. | |
bool | CpFile (const char *pszSrcFileName, const char *pszDestFileName) |
파일을 복사한다. | |
int | RandomGet () |
random 정수를 리턴한다. | |
void | SetCoreDumpEnable () |
리눅스에서 일반 사용자로 수정한 후, core dump 파일 생성 가능하게 한다. | |
bool | Fork (bool bIsFork) |
데몬 모드로 동작한다. | |
bool | ChangeExecuteUser (const char *pszUserId) |
프로그램 실행 사용자를 수정한다. | |
bool | StartThread (const char *pszName, void *(*lpStartAddress)(void *), void *lpParameter) |
쓰레드를 시작한다. | |
void | SipMd5String (const char *pszPlainText, char szMd5[33]) |
평문을 MD5 문자열로 변환한다. | |
void | SipMd5Byte (const char *pszPlainText, unsigned char szMd5[16]) |
평문을 MD5 해쉬한다. | |
bool | GetIpByName (const char *szHostName, char *szIp, int iLen) |
호스트 이름으로 IP 주소를 검색한다. | |
Socket | TcpConnect (const char *pszIp, int iPort, int iTimeout) |
TCP 서버에 연결한다. | |
int | TcpSend (Socket fd, const char *szBuf, int iBufLen) |
네트워크 전송 함수 | |
int | TcpRecv (Socket fd, char *szBuf, int iBufLen, int iSecond) |
timeout 을 가진 TCP 수신 메소드 | |
int | TcpRecvSize (Socket fd, char *szBuf, int iBufLen, int iSecond) |
수신 버퍼가 가득 찰 때까지 데이터를 수신한다. | |
Socket | TcpListen (int iPort, int iListenQ, const char *pszIp, bool bIpv6) |
TCP 서버 소켓을 생성한다. | |
Socket | TcpAccept (Socket hListenFd, char *pszIp, int iIpSize, int *piPort, bool bIpv6) |
TCP accept wrapper function. | |
bool | GetLocalIpPort (Socket hSocket, std::string &strIp, int &iPort) |
소켓의 로컬 IP 주소와 포트 번호를 리턴한다. | |
Socket | UdpSocket (bool bIpv6) |
UDP 소켓을 생성한다. | |
Socket | UdpListen (unsigned short iPort, const char *pszIp, bool bIpv6) |
UDP listen 소켓을 생성한다. | |
bool | UdpRecv (Socket iFd, char *pszBuf, int *piLen, char *pszIp, int iIpSize, unsigned short *piPort, bool bIpv6) |
UDP 메시지를 수신한다. | |
bool | UdpRecv (Socket iFd, char *pszBuf, int *piLen, unsigned int *piIp, unsigned short *piPort) |
IPv4 로 UDP 메시지를 수신한다. | |
bool | UdpRecv (Socket iFd, char *pszBuf, int *piLen, IN6_ADDR *psttIp, unsigned short *piPort) |
IPv6 로 UDP 메시지를 수신한다. | |
bool | UdpSend (Socket iFd, const char *pszBuf, int iBufLen, const char *pszIp, unsigned short iPort) |
UDP 메시지를 전송한다. | |
bool | UdpSend (Socket iFd, const char *pszBuf, int iBufLen, unsigned int iIp, unsigned short iPort) |
IPv4 로 UDP 메시지를 전송한다. | |
bool | UdpSend (Socket iFd, const char *pszBuf, int iBufLen, IN6_ADDR *psttIp, unsigned short iPort) |
IPv6 로 UDP 메시지를 전송한다. | |
void | InitNetwork () |
네트워크 API 를 초기화시킨다. | |
bool | GetLocalIp (std::string &strIp) |
localhost IP 주소를 제외한 호스트에 연결된 IP 주소를 가져온다. | |
void | ReplaceString (std::string &strCallId, const char *pszBefore, const char *pszAfter) |
문자열에 포함된 문자열을 수정한다. | |
bool | SearchValue (std::string &strText, const char *pszKey, char cSep, std::string &strValue) |
문자열에 포함된 키의 값을 추출한다. | |
bool | SearchValue (std::string &strText, const char *pszKey, char cSep, int &iValue) |
문자열에 포함된 키의 값을 추출한다. | |
bool | SearchStringList (STRING_LIST &clsList, const char *pszKey) |
검색 문자열이 문자열 리스트에 존재하는지 검사한다. | |
bool | DeleteStringList (STRING_LIST &clsList, const char *pszKey) |
검색 문자열이 문자열 리스트에 존재하면 삭제한다. | |
void | InsertStringList (STRING_LIST &clsList, const char *pszKey) |
문자열이 문자열 리스트에 존재하지 않으면 추가한다. | |
void | InsertStringList (STRING_LIST &clsList, STRING_LIST &clsSrcList) |
입력 문자열 리스트의 각 문자열이 저장 문자열 리스트에 존재하지 않으면 저장 문자열 리스트에 저장한다. | |
void | LogStringList (EnumLogLevel eLevel, const char *pszName, STRING_LIST &clsList) |
문자열 리스트를 로그로 출력한다. | |
void | LeftTrimString (std::string &strText) |
문자열의 왼쪽 공백을 제거한다. | |
void | RightTrimString (std::string &strText) |
문자열의 오른쪽 공백을 제거한다. | |
void | TrimString (std::string &strText) |
문자열의 왼쪽, 오른쪽 공백을 제거한다. | |
void | SplitString (const char *pszText, STRING_LIST &clsList, char cSep) |
입력 문자열을 구분자로 분리하여서 문자열 리스트에 저장한다. | |
void | SplitString (const char *pszText, STRING_VECTOR &clsList, char cSep) |
입력 문자열을 구분자로 분리하여서 문자열 리스트에 저장한다. | |
uint32_t | GetUInt32 (const char *pszText) |
문자열을 unsigned int 로 변환한다. | |
uint64_t | GetUInt64 (const char *pszText) |
문자열을 unsigned long long 으로 변환한다. | |
int | GetInt (const char *pszText, int iTextLen) |
지정될 길이만큼의 문자열을 숫자로 변환한다. | |
bool | HexToString (const char *pszInput, std::string &strOutput) |
HEX 만 저장된 문자열을 숫자로 변환한 문자열로 변환한다. | |
void | StringToHex (const char *pszInput, int iInputLen, std::string &strOutput) |
숫자가 저장된 문자열을 HEX 만 저장된 문자열로 변환한다. | |
bool | IsPrintString (const char *pszText, int iTextLen) |
문자열이 출력 가능한지 검사한다. | |
void | DeQuoteString (std::string &strInput, std::string &strOutput) |
입력된 문자열에서 " 를 제거한 출력 문자열을 저장한다. | |
void | LocalTime (time_t iTime, struct tm &sttTm) |
현재 시간을 년,월,일,시,분,초 구조체에 저장한다. | |
void | GetDateTimeString (time_t iTime, char *pszTime, int iTimeSize) |
시간 변수를 시간 문자열 변수에 저장한다. | |
void | GetDateTimeString (char *pszTime, int iTimeSize) |
년월일시분초 문자열을 저장한다. | |
void | GetDateString (time_t iTime, char *pszDate, int iDateSize) |
년월일 문자열을 저장한다. | |
void | GetDateString (char *pszDate, int iDateSize) |
년월일 문자열을 저장한다. | |
void | GetTimeString (time_t iTime, char *pszTime, int iTimeSize) |
시분초 문자열을 저장한다. | |
void | GetTimeString (char *pszTime, int iTimeSize) |
시분초 문자열을 저장한다. | |
time_t | ParseDateTimeString (const char *pszTime) |
년월일시분초 문자열을 time_t 로 변환한다. | |
int | DiffTimeval (struct timeval *psttOld, struct timeval *psttNew) |
두 개의 시간의 차이를 리턴한다. | |
void | MiliSleep (int iMiliSecond) |
ms 동안 대기한다. | |
uint64_t | GetCurrentMiliSecond () |
현재 시간을 ms 단위로 리턴한다. | |
static bool | CDirectory::Create (const char *szDirName, int iDirMode=DIR_MODE) |
디렉토리를 생성한다. | |
static bool | CDirectory::IsDirectory (const char *szDirName) |
사용자가 입력한 path 가 디렉토리인지를 점검한다. | |
static int | CDirectory::IsDirectoryCheck (const char *szDirName) |
사용자가 입력한 path 가 디렉토리인지를 점검한다. | |
static void | CDirectory::AppendName (std::string &strFileName, const char *pszAppend) |
파일 경로에 파일 이름을 추가한다. | |
static bool | CDirectory::List (const char *pszDirName, FILE_LIST &clsFileList) |
폴더에 존재하는 모든 파일/폴더 리스트를 가져온다. | |
static bool | CDirectory::FileList (const char *pszDirName, FILE_LIST &clsFileList) |
폴더에 존재하는 모든 파일 리스트를 가져온다. | |
static char * | CDirectory::GetProgramDirectory () |
프로그램을 시작한 폴더를 가져온다. | |
static int64_t | CDirectory::GetSize (const char *pszDirName) |
폴더 크기를 가져온다. | |
static void | CDirectory::DeleteAllFile (const char *pszDirName) |
폴더에 포함된 파일들을 모두 삭제한다. | |
static void | CDirectory::GetDirName (const char *pszFilePath, std::string &strDirName) |
파일 경로에서 폴더 이름을 가져온다. | |
static void | CDirectory::GetFileName (const char *pszFilePath, std::string &strFileName) |
파일 경로에서 파일 이름을 가져온다. | |
static bool | CDirectory::Delete (const char *pszDirName) |
폴더를 모두 삭제한다. | |
bool | CFileLog::Open (const char *pszDirName) |
로그 파일을 저장할 디렉토리를 설정한다. | |
bool | CFileLog::Close () |
로그 파일 저장을 중지한다. | |
bool | CFileLog::Print (EnumLogLevel iLevel, const char *fmt,...) |
로그 파일에 로그를 저장한다. | |
int | CFileLog::GetLevel () |
로그 레벨을 가져온다. | |
void | CFileLog::SetLevel (int iLevel) |
로그 파일에 저장할 로그 레벨을 설정한다. | |
bool | CFileLog::IsPrintLogLevel (EnumLogLevel iLevel) |
입력한 로그 레벨이 현재 출력할 수 있는 로그 레벨인지 분석하여 준다. | |
void | CFileLog::SetMaxLogSize (int iSize) |
로그를 저장할 최대 파일 크기를 설정한다. | |
void | CFileLog::SetMaxFolderSize (int64_t iSize) |
로그 폴더 최대 크기를 설정한다. | |
static bool | CLog::SetDirectory (const char *pszDirName) |
로그 파일을 저장할 디렉토리를 설정한다. | |
static void | CLog::Release () |
클래스 변수를 초기화시킨다. | |
static void | CLog::SetCallBack (ILogCallBack *pclsCallBack) |
로그 출력 callback 인터페이스를 등록한다. | |
static int | CLog::Print (EnumLogLevel iLevel, const char *fmt,...) |
로그 파일에 로그를 저장한다. | |
static void | CLog::Print (void(*func)(FILE *fd)) |
응용에서 로그를 출력하는 경우, FILE 핸들을 응용 함수로 전달한다. | |
static int | CLog::GetLevel () |
로그 레벨을 가져온다. | |
static void | CLog::SetLevel (int iLevel) |
로그 파일에 저장할 로그 레벨을 설정한다. | |
static void | CLog::SetNullLevel () |
로그 파일에 저장할 로그 레벨을 모두 삭제한다. | |
static void | CLog::SetDebugLevel () |
디버그 로그 레벨을 설정한다. | |
static bool | CLog::IsPrintLogLevel (EnumLogLevel iLevel) |
입력한 로그 레벨이 현재 출력할 수 있는 로그 레벨인지 분석하여 준다. | |
static void | CLog::SetMaxLogSize (int iSize) |
로그를 저장할 최대 파일 크기를 설정한다. | |
static void | CLog::SetMaxFolderSize (int64_t iSize) |
로그 폴더 최대 크기를 설정한다. | |
static int | CLog::GetLogIndex () |
로그파일의 인덱스 번호를 리턴한다. | |
static void | CLog::DeleteOldFile () |
로그 폴더의 크기가 설정된 크기보다 큰 경우, 오래된 로그 파일을 삭제한다. | |
static void | CLog::SortFileList (FILE_LIST &clsFileList) |
로그 파일 리스트를 오래된 날짜에서 최근 날짜로 정렬한다. | |
int | CRandom::Get () |
random 정수를 리턴한다. | |
CSipMutex::CSipMutex () | |
생성자 | |
CSipMutex::~CSipMutex () | |
소멸자 | |
bool | CSipMutex::acquire () |
mutex lock 한다. | |
bool | CSipMutex::release () |
mutex unlock 한다. | |
CSipMutexSignal::CSipMutexSignal () | |
생성자 | |
CSipMutexSignal::~CSipMutexSignal () | |
소멸자 | |
bool | CSipMutexSignal::wait () |
signal 또는 broadcast 메소드가 호출될 때까지 대기한다. | |
bool | CSipMutexSignal::signal () |
signal 또는 broadcast 메소드가 호출될 때까지 대기하는 쓰레드 1개를 대기 중지시킨다. | |
bool | CSipMutexSignal::broadcast () |
signal 또는 broadcast 메소드가 호출될 때까지 대기하는 모든 쓰레드를 대기 중지시킨다. | |
bool | CStringMap::Insert (const char *pszKey, const char *pszValue) |
문자열 맵 자료구조에 문자열 키, 값을 저장한다. | |
bool | CStringMap::Select (const char *pszKey) |
문자열 맵 자료구조에 문자열 키가 존재하는지 검색한다. | |
bool | CStringMap::Select (const char *pszKey, std::string &strValue) |
문자열 맵 자료구조에 문자열 키가 존재하는지 검색한다. | |
bool | CStringMap::Delete (const char *pszKey) |
문자열 맵 자료구조에 문자열 키가 존재하면 삭제한다. | |
int | CStringMap::GetCount () |
문자열 맵 자료구조에 저장된 문자열 개수를 리턴한다. | |
void | CStringMap::DeleteAll () |
자료구조에 저장된 데이터를 모두 삭제한다. |
SIP stack 프로젝트에서 사용되는 OS independent 라이브러리
enum EnumLogLevel |
로그 레벨 관련 ENUM CLog 에서 사용하는 ENUM 이다.
bool CSipMutex::acquire | ( | ) |
mutex lock 한다.
|
static |
파일 경로에 파일 이름을 추가한다.
strFileName | 파일 경로 |
pszAppend | 추가할 파일 이름 |
int Base64Decode | ( | const char * | pszInput, |
int | iInputLength, | ||
char * | pszOutput, | ||
int | iOutputLength | ||
) |
base64 문자열을 plain text 문자열로 변환한다.
pszInput | base64 문자열 |
iInputLength | base64 문자열 길이 |
pszOutput | plain text 를 저장할 변수 |
iOutputLength | plain text 를 저장할 변수의 크기 |
int Base64Encode | ( | const char * | pszInput, |
int | iInputLength, | ||
char * | pszOutput, | ||
int | iOutputLength | ||
) |
plain text 를 base64 문자열로 변환한다.
pszInput | plain text 문자열 |
iInputLength | plain text 문자열의 길이 |
pszOutput | base64 문자열 저장 변수 |
iOutputLength | base64 문자열 저장 변수의 크기 |
bool Base64Encode | ( | const char * | pszInput, |
int | iInputLength, | ||
std::string & | strOutput | ||
) |
plain text 를 base64 문자열로 변환한다.
pszInput | plain text 문자열 |
iInputLength | plain text 문자열의 길이 |
strOutput | base64 문자열 저장 변수 |
bool CSipMutexSignal::broadcast | ( | ) |
signal 또는 broadcast 메소드가 호출될 때까지 대기하는 모든 쓰레드를 대기 중지시킨다.
bool ChangeExecuteUser | ( | const char * | pszUserId | ) |
프로그램 실행 사용자를 수정한다.
pszUserId | 프로그램 실행 사용자 |
bool CFileLog::Close | ( | ) |
로그 파일 저장을 중지한다.
bool CpFile | ( | const char * | pszSrcFileName, |
const char * | pszDestFileName | ||
) |
파일을 복사한다.
pszSrcFileName | 원본 파일 path |
pszDestFileName | 복사본 파일 path |
|
static |
디렉토리를 생성한다.
이미 디렉토리가 생성되어 있으면 아무런 동작을 하지 않는다. "c:\temp\test" 와 같은 문자열을 입력하면 다음과 같이 동작하다. "c:\temp" 디렉토리가 존재하지 않으면 이를 생성한 후, "c:\temp\test" 디렉토리를 생성한다.
szDirName | [in] 생성할 디렉토리의 full pathname |
iDirMode | [in] 생성할 디렉토리의 권한 |
CSipMutex::CSipMutex | ( | ) |
생성자
CSipMutexSignal::CSipMutexSignal | ( | ) |
생성자
bool CStringMap::Delete | ( | const char * | pszKey | ) |
문자열 맵 자료구조에 문자열 키가 존재하면 삭제한다.
pszKey | 문자열 키 |
|
static |
폴더를 모두 삭제한다.
pszDirName | 폴더 이름 |
void CStringMap::DeleteAll | ( | ) |
자료구조에 저장된 데이터를 모두 삭제한다.
|
static |
폴더에 포함된 파일들을 모두 삭제한다.
pszDirName | 폴더 full path |
|
static |
로그 폴더의 크기가 설정된 크기보다 큰 경우, 오래된 로그 파일을 삭제한다.
bool DeleteStringList | ( | STRING_LIST & | clsList, |
const char * | pszKey | ||
) |
검색 문자열이 문자열 리스트에 존재하면 삭제한다.
clsList | 문자열 리스트 |
pszKey | 검색 문자열 |
void DelFile | ( | const char * | pszFileName | ) |
파일을 삭제한다.
pszFileName | 파일 이름 |
void DeQuoteString | ( | std::string & | strInput, |
std::string & | strOutput | ||
) |
입력된 문자열에서 " 를 제거한 출력 문자열을 저장한다.
strInput | 입력 문자열 |
strOutput | 출력 문자열 |
int DiffTimeval | ( | struct timeval * | psttOld, |
struct timeval * | psttNew | ||
) |
두 개의 시간의 차이를 리턴한다.
psttOld | 시작 시간 |
psttNew | 종료 시간 |
|
static |
폴더에 존재하는 모든 파일 리스트를 가져온다.
pszDirName | 폴더 경로 |
clsFileList | 파일 리스트를 저장할 변수 |
bool Fork | ( | bool | bIsFork | ) |
데몬 모드로 동작한다.
bIsFork | 데몬 모드로 동작하면 true 를 넣어주고 그렇지 않으면 false 를 넣어준다. |
int CRandom::Get | ( | ) |
random 정수를 리턴한다.
int GetBase64DecodeLength | ( | int | iLength | ) |
base64 문자열을 plain text 로 변환하였을 때에 plain text 의 길이를 리턴한다.
iLength | base64 문자열의 길이 |
int GetBase64EncodeLength | ( | int | iLength | ) |
plain text 를 base64 문자열로 변환하였을 때의 base64 문자열의 길이를 리턴한다.
iLength | plain text 문자열 |
int CStringMap::GetCount | ( | ) |
문자열 맵 자료구조에 저장된 문자열 개수를 리턴한다.
uint64_t GetCurrentMiliSecond | ( | ) |
현재 시간을 ms 단위로 리턴한다.
void GetDateString | ( | time_t | iTime, |
char * | pszDate, | ||
int | iDateSize | ||
) |
년월일 문자열을 저장한다.
iTime | 시간 |
pszDate | 년월일 문자열을 저장 변수 |
iDateSize | pszDate 변수의 크기 |
void GetDateString | ( | char * | pszDate, |
int | iDateSize | ||
) |
년월일 문자열을 저장한다.
pszDate | 년월일 문자열을 저장 변수 |
iDateSize | pszDate 변수의 크기 |
void GetDateTimeString | ( | time_t | iTime, |
char * | pszTime, | ||
int | iTimeSize | ||
) |
시간 변수를 시간 문자열 변수에 저장한다.
iTime | 시간 변수 |
pszTime | 시간 문자열이 저장될 변수 |
iTimeSize | pszTime 변수의 크기 |
void GetDateTimeString | ( | char * | pszTime, |
int | iTimeSize | ||
) |
년월일시분초 문자열을 저장한다.
pszTime | 년월일시분초 문자열 저장 변수 |
iTimeSize | pszTime 변수의 크기 |
|
static |
파일 경로에서 폴더 이름을 가져온다.
pszFilePath | 파일 경로 |
strDirName | 폴더 이름을 저장할 변수 |
bool GetFileDate | ( | const char * | pszFileName, |
std::string & | strDate | ||
) |
파일의 수정 시간을 가져온다.
pszFileName | 파일 이름 |
strDate | [out] 파일 수정 시간 저장 변수 |
bool GetFileExt | ( | const char * | pszFileName, |
std::string & | strExt | ||
) |
파일 이름에서 파일 확장자를 가져온다.
pszFileName | 파일 이름 |
strExt | 파일 확장자 저장 변수 |
|
static |
파일 경로에서 파일 이름을 가져온다.
pszFilePath | 파일 경로 |
strFileName | 파일 이름을 저장할 변수 |
bool GetFileNameOfFilePath | ( | const char * | pszFilePath, |
std::string & | strFileName | ||
) |
파일 경로에서 파일 이름 가져오기
pszFilePath | 파일 경로 |
strFileName | 파일 이름 저장 변수 |
int64_t GetFileSize | ( | const char * | pszFileName | ) |
파일 크기를 리턴한다.
pszFileName | 파일 이름 |
bool GetFolderPathOfFilePath | ( | const char * | pszFilePath, |
std::string & | strFolder | ||
) |
파일 경로에서 폴더 경로 가져오기
pszFilePath | 파일 경로 |
strFolder | 폴더 경로 저장 변수 |
int GetInt | ( | const char * | pszText, |
int | iTextLen | ||
) |
지정될 길이만큼의 문자열을 숫자로 변환한다.
pszText | 숫자 문자열 |
iTextLen | 문자열 길이 |
bool GetIpByName | ( | const char * | szHostName, |
char * | szIp, | ||
int | iLen | ||
) |
호스트 이름으로 IP 주소를 검색한다.
szHostName | 호스트 이름 |
szIp | IP 주소를 저장할 변수 |
iLen | IP 주소를 저장할 변수의 크기 |
int CFileLog::GetLevel | ( | ) |
로그 레벨을 가져온다.
|
static |
로그 레벨을 가져온다.
bool GetLocalIp | ( | std::string & | strIp | ) |
localhost IP 주소를 제외한 호스트에 연결된 IP 주소를 가져온다.
strIp | IP 주소를 저장할 변수 |
bool GetLocalIpPort | ( | Socket | hSocket, |
std::string & | strIp, | ||
int & | iPort | ||
) |
소켓의 로컬 IP 주소와 포트 번호를 리턴한다.
hSocket | 소켓 |
strIp | 로컬 IP 주소 저장 변수 |
iPort | 로컬 포트 번호 저장 변수 |
|
static |
로그파일의 인덱스 번호를 리턴한다.
|
static |
프로그램을 시작한 폴더를 가져온다.
|
static |
폴더 크기를 가져온다.
pszDirName | 폴더 fulll path |
void GetTimeString | ( | time_t | iTime, |
char * | pszTime, | ||
int | iTimeSize | ||
) |
시분초 문자열을 저장한다.
iTime | 시간 |
pszTime | 시분초 문자열 저장 변수 |
iTimeSize | pszTime 변수의 크기 |
void GetTimeString | ( | char * | pszTime, |
int | iTimeSize | ||
) |
시분초 문자열을 저장한다.
pszTime | 시분초 문자열 저장 변수 |
iTimeSize | pszTime 변수의 크기 |
uint32_t GetUInt32 | ( | const char * | pszText | ) |
문자열을 unsigned int 로 변환한다.
pszText | 문자열 |
uint64_t GetUInt64 | ( | const char * | pszText | ) |
문자열을 unsigned long long 으로 변환한다.
pszText | 문자열 |
bool HexToString | ( | const char * | pszInput, |
std::string & | strOutput | ||
) |
HEX 만 저장된 문자열을 숫자로 변환한 문자열로 변환한다.
pszInput | HEX 만 저장된 문자열 |
strOutput | [out] 숫자로 변환된 문자열 |
void InitNetwork | ( | ) |
네트워크 API 를 초기화시킨다.
bool CStringMap::Insert | ( | const char * | pszKey, |
const char * | pszValue | ||
) |
문자열 맵 자료구조에 문자열 키, 값을 저장한다.
pszKey | 문자열 키 |
pszValue | 문자열 값 |
void InsertStringList | ( | STRING_LIST & | clsList, |
const char * | pszKey | ||
) |
문자열이 문자열 리스트에 존재하지 않으면 추가한다.
clsList | 문자열 리스트 |
pszKey | 문자열 |
void InsertStringList | ( | STRING_LIST & | clsList, |
STRING_LIST & | clsSrcList | ||
) |
입력 문자열 리스트의 각 문자열이 저장 문자열 리스트에 존재하지 않으면 저장 문자열 리스트에 저장한다.
clsList | 저장 문자열 리스트 |
clsSrcList | 입력 문자열 리스트 |
|
static |
사용자가 입력한 path 가 디렉토리인지를 점검한다.
szDirName | [in] 디렉토리 이름 |
|
static |
사용자가 입력한 path 가 디렉토리인지를 점검한다.
szDirName | [in] 디렉토리 이름 |
bool IsExistFile | ( | const char * | pszFileName | ) |
파일이 존재하는지 검사한다.
pszFileName | 파일 이름 |
bool CFileLog::IsPrintLogLevel | ( | EnumLogLevel | iLevel | ) |
입력한 로그 레벨이 현재 출력할 수 있는 로그 레벨인지 분석하여 준다.
iLevel | [in] 로그 레벨 |
|
static |
입력한 로그 레벨이 현재 출력할 수 있는 로그 레벨인지 분석하여 준다.
iLevel | [in] 로그 레벨 |
bool IsPrintString | ( | const char * | pszText, |
int | iTextLen | ||
) |
문자열이 출력 가능한지 검사한다.
pszText | 문자열 |
iTextLen | 문자열 길이 |
void LeftTrimString | ( | std::string & | strText | ) |
문자열의 왼쪽 공백을 제거한다.
strText | 문자열 |
|
static |
폴더에 존재하는 모든 파일/폴더 리스트를 가져온다.
pszDirName | 폴더 경로 |
clsFileList | 파일/폴더 리스트를 저장할 변수 |
void LocalTime | ( | time_t | iTime, |
struct tm & | sttTm | ||
) |
현재 시간을 년,월,일,시,분,초 구조체에 저장한다.
iTime | 현재 시간 |
sttTm | 년,월,일,시,분,초 구조체 |
void LogStringList | ( | EnumLogLevel | eLevel, |
const char * | pszName, | ||
STRING_LIST & | clsList | ||
) |
문자열 리스트를 로그로 출력한다.
eLevel | 로그 레벨 |
pszName | 로그 메시지 이름 |
clsList | 문자열 리스트 |
void MiliSleep | ( | int | iMiliSecond | ) |
ms 동안 대기한다.
iMiliSecond | ms |
bool CFileLog::Open | ( | const char * | pszDirName | ) |
로그 파일을 저장할 디렉토리를 설정한다.
pszDirName | 로그 파일을 저장할 디렉토리 |
time_t ParseDateTimeString | ( | const char * | pszTime | ) |
년월일시분초 문자열을 time_t 로 변환한다.
pszTime | 년월일시분초 문자열 |
bool CFileLog::Print | ( | EnumLogLevel | iLevel, |
const char * | fmt, | ||
... | |||
) |
로그 파일에 로그를 저장한다.
iLevel | 로그 파일 레벨 |
fmt | 로그 파일에 저장할 포맷 문자열 |
... | fmt 포맷에 입력할 인자들 |
|
static |
로그 파일에 로그를 저장한다.
iLevel | [in] 로그 파일 레벨 |
fmt | [in] 로그 파일에 저장할 포맷 문자열 |
... | [in] fmt 포맷에 입력할 인자들 |
|
static |
응용에서 로그를 출력하는 경우, FILE 핸들을 응용 함수로 전달한다.
func | 로그 출력 함수 |
int RandomGet | ( | ) |
random 정수를 리턴한다.
bool CSipMutex::release | ( | ) |
mutex unlock 한다.
|
static |
클래스 변수를 초기화시킨다.
void ReplaceString | ( | std::string & | strCallId, |
const char * | pszBefore, | ||
const char * | pszAfter | ||
) |
문자열에 포함된 문자열을 수정한다.
strCallId | 문자열 |
pszBefore | 수정 대상 문자열 |
pszAfter | 수정 대상 문자열을 수정할 문자열 |
void RightTrimString | ( | std::string & | strText | ) |
문자열의 오른쪽 공백을 제거한다.
strText | 문자열 |
bool SearchStringList | ( | STRING_LIST & | clsList, |
const char * | pszKey | ||
) |
검색 문자열이 문자열 리스트에 존재하는지 검사한다.
clsList | 문자열 리스트 |
pszKey | 검색 문자열 |
bool SearchValue | ( | std::string & | strText, |
const char * | pszKey, | ||
char | cSep, | ||
std::string & | strValue | ||
) |
문자열에 포함된 키의 값을 추출한다.
"app=36;msg=36;hotline=46;presence=36; broadcast=46" 문자열에서 app 의 값을 추출하고 싶으면 pszKey 에 "app=" 를 입력하고 cSep 에 ';' 를 입력하면 된다.
strText | 문자열 |
pszKey | 키 |
cSep | 구분자 |
strValue | 키의 값을 저장할 변수 |
bool SearchValue | ( | std::string & | strText, |
const char * | pszKey, | ||
char | cSep, | ||
int & | iValue | ||
) |
문자열에 포함된 키의 값을 추출한다.
"app=36;msg=36;hotline=46;presence=36; broadcast=46" 문자열에서 app 의 값을 추출하고 싶으면 pszKey 에 "app=" 를 입력하고 cSep 에 ';' 를 입력하면 된다.
strText | 문자열 |
pszKey | 키 |
cSep | 구분자 |
iValue | 키의 값을 저장할 변수 |
bool CStringMap::Select | ( | const char * | pszKey | ) |
문자열 맵 자료구조에 문자열 키가 존재하는지 검색한다.
pszKey | 문자열 키 |
bool CStringMap::Select | ( | const char * | pszKey, |
std::string & | strValue | ||
) |
문자열 맵 자료구조에 문자열 키가 존재하는지 검색한다.
pszKey | 문자열 키 |
strValue | 키에 대한 값을 저장할 변수 |
|
static |
로그 출력 callback 인터페이스를 등록한다.
pclsCallBack | 로그 출력 callback 인터페이스 |
void SetCoreDumpEnable | ( | ) |
리눅스에서 일반 사용자로 수정한 후, core dump 파일 생성 가능하게 한다.
|
static |
디버그 로그 레벨을 설정한다.
|
static |
로그 파일을 저장할 디렉토리를 설정한다.
만약 thread mutex 가 설정되어 있지 않으면 쓰레드 mutex 를 생성한다.
pszDirName | [in] 로그 파일을 저장할 디렉토리 |
bool SetFileDate | ( | const char * | pszFileName, |
const char * | pszDate | ||
) |
파일의 수정 시간을 설정한다.
pszFileName | 파일 이름 |
pszDate | 파일 수정 시간 |
void CFileLog::SetLevel | ( | int | iLevel | ) |
로그 파일에 저장할 로그 레벨을 설정한다.
여러 로그를 저장할 경우, '|' 연산자를 이용하여서 여러 로그 레벨을 설정할 수 있다.
iLevel | [in] 디버그 로그를 저장할 경우, LOG_DEBUG 를 설정한다. 정보 로그를 저장할 경우, LOG_INFO 를 설정한다. 에러 로그를 저장할 경우, LOG_ERROR 를 설정한다. |
|
static |
로그 파일에 저장할 로그 레벨을 설정한다.
여러 로그를 저장할 경우, '|' 연산자를 이용하여서 여러 로그 레벨을 설정할 수 있다.
iLevel | [in] 디버그 로그를 저장할 경우, LOG_DEBUG 를 설정한다. 정보 로그를 저장할 경우, LOG_INFO 를 설정한다. 에러 로그를 저장할 경우, LOG_ERROR 를 설정한다. |
void CFileLog::SetMaxFolderSize | ( | int64_t | iSize | ) |
로그 폴더 최대 크기를 설정한다.
iSize | 로그 폴더 최대 크기 |
|
static |
로그 폴더 최대 크기를 설정한다.
iSize | 로그 폴더 최대 크기 |
void CFileLog::SetMaxLogSize | ( | int | iSize | ) |
로그를 저장할 최대 파일 크기를 설정한다.
iSize | 로그를 저장할 최대 파일 크기 |
|
static |
로그를 저장할 최대 파일 크기를 설정한다.
iSize | 로그를 저장할 최대 파일 크기 |
|
static |
로그 파일에 저장할 로그 레벨을 모두 삭제한다.
bool CSipMutexSignal::signal | ( | ) |
signal 또는 broadcast 메소드가 호출될 때까지 대기하는 쓰레드 1개를 대기 중지시킨다.
void SipMd5Byte | ( | const char * | pszPlainText, |
unsigned char | szMd5[16] | ||
) |
평문을 MD5 해쉬한다.
pszPlainText | 평문 문자열 |
szMd5 | MD5 해쉬 결과값을 저장할 변수 ( 문자열이 아닌 바이너리 ) |
void SipMd5String | ( | const char * | pszPlainText, |
char | szMd5[33] | ||
) |
평문을 MD5 문자열로 변환한다.
pszPlainText | 평문 문자열 |
szMd5 | MD5 문자열 저장 변수 |
|
static |
로그 파일 리스트를 오래된 날짜에서 최근 날짜로 정렬한다.
clsFileList | 로그 파일 리스트 |
void SplitString | ( | const char * | pszText, |
STRING_LIST & | clsList, | ||
char | cSep | ||
) |
입력 문자열을 구분자로 분리하여서 문자열 리스트에 저장한다.
pszText | 입력 문자열 |
clsList | 문자열 리스트 |
cSep | 구분자 |
void SplitString | ( | const char * | pszText, |
STRING_VECTOR & | clsList, | ||
char | cSep | ||
) |
입력 문자열을 구분자로 분리하여서 문자열 리스트에 저장한다.
pszText | 입력 문자열 |
clsList | 문자열 리스트 |
cSep | 구분자 |
bool StartThread | ( | const char * | pszName, |
void *(*)(void *) | lpStartAddress, | ||
void * | lpParameter | ||
) |
쓰레드를 시작한다.
pszName | 쓰레드 이름 |
lpStartAddress | 쓰레드 함수 |
lpParameter | 쓰레드 인자 |
void StringToHex | ( | const char * | pszInput, |
int | iInputLen, | ||
std::string & | strOutput | ||
) |
숫자가 저장된 문자열을 HEX 만 저장된 문자열로 변환한다.
pszInput | 숫자가 저장된 문자열 |
iInputLen | pszInput 변수의 길이 |
strOutput | [out] HEX 만 저장된 문자열 |
Socket TcpAccept | ( | Socket | hListenFd, |
char * | pszIp, | ||
int | iIpSize, | ||
int * | piPort, | ||
bool | bIpv6 | ||
) |
TCP accept wrapper function.
hListenFd | TCP 서버 소켓 |
pszIp | 연결된 클라이언트 IP 주소가 저장될 변수 |
iIpSize | pszIp 변수의 크기 |
piPort | 연결된 클라이언트 포트가 저장될 변수 |
bIpv6 | IPv6 인가? |
Socket TcpConnect | ( | const char * | pszIp, |
int | iPort, | ||
int | iTimeout | ||
) |
TCP 서버에 연결한다.
pszIp | TCP 서버 IP 주소 |
iPort | TCP 서버 포트 번호 |
iTimeout | 연결 timeout 시간 ( 초단위 ) - 0 이상으로 설정해야 연결 timeout 기능이 동작한다. |
Socket TcpListen | ( | int | iPort, |
int | iListenQ, | ||
const char * | pszIp, | ||
bool | bIpv6 | ||
) |
TCP 서버 소켓을 생성한다.
iPort | TCP 포트 번호 |
iListenQ | queue number to listen |
pszIp | 수신 IP 주소 |
bIpv6 | IPv6 인가? |
int TcpRecv | ( | Socket | fd, |
char * | szBuf, | ||
int | iBufLen, | ||
int | iSecond | ||
) |
timeout 을 가진 TCP 수신 메소드
fd | 소켓 핸들 |
szBuf | 수신 버퍼 |
iBufLen | 수신 버퍼 크기 |
iSecond | 수신 timeout ( 초 단위 ) |
int TcpRecvSize | ( | Socket | fd, |
char * | szBuf, | ||
int | iBufLen, | ||
int | iSecond | ||
) |
수신 버퍼가 가득 찰 때까지 데이터를 수신한다.
fd | 소켓 핸들 |
szBuf | 수신 버퍼 |
iBufLen | 수신 버퍼 크기 |
iSecond | 수신 timeout ( 초 단위 ) |
int TcpSend | ( | Socket | fd, |
const char * | szBuf, | ||
int | iBufLen | ||
) |
네트워크 전송 함수
fd | 소켓 핸들 |
szBuf | 전송 버퍼 |
iBufLen | 전송 버퍼 크기 |
void TrimString | ( | std::string & | strText | ) |
문자열의 왼쪽, 오른쪽 공백을 제거한다.
strText | 문자열 |
Socket UdpListen | ( | unsigned short | iPort, |
const char * | pszIp, | ||
bool | bIpv6 | ||
) |
UDP listen 소켓을 생성한다.
iPort | UDP 포트 |
pszIp | UDP IP 주소. NULL 을 입력하면 any ip 주소를 사용한다. |
bIpv6 | IPv6 소켓을 생성할 것인가? |
bool UdpRecv | ( | Socket | iFd, |
char * | pszBuf, | ||
int * | piLen, | ||
char * | pszIp, | ||
int | iIpSize, | ||
unsigned short * | piPort, | ||
bool | bIpv6 | ||
) |
UDP 메시지를 수신한다.
iFd | 소켓 핸들 |
pszBuf | 수신 버퍼 |
piLen | 수신 패킷 크기를 저장할 변수 |
pszIp | IP 주소 |
iIpSize | IP 주소 변수 크기 |
piPort | 포트 번호 |
bIpv6 | IPv6 소켓인가? |
bool UdpRecv | ( | Socket | iFd, |
char * | pszBuf, | ||
int * | piLen, | ||
unsigned int * | piIp, | ||
unsigned short * | piPort | ||
) |
IPv4 로 UDP 메시지를 수신한다.
iFd | 소켓 핸들 |
pszBuf | 수신 버퍼 |
piLen | 수신 패킷 크기 |
piIp | IP 주소 |
piPort | 포트 번호 |
bool UdpRecv | ( | Socket | iFd, |
char * | pszBuf, | ||
int * | piLen, | ||
IN6_ADDR * | psttIp, | ||
unsigned short * | piPort | ||
) |
IPv6 로 UDP 메시지를 수신한다.
iFd | 소켓 핸들 |
pszBuf | 수신 버퍼 |
piLen | 수신 패킷 크기 |
psttIp | IP 주소 |
piPort | 포트 번호 |
bool UdpSend | ( | Socket | iFd, |
const char * | pszBuf, | ||
int | iBufLen, | ||
const char * | pszIp, | ||
unsigned short | iPort | ||
) |
UDP 메시지를 전송한다.
iFd | 소캣 핸들 |
pszBuf | 전송 버퍼 |
iBufLen | 전송 버퍼 길이 |
pszIp | 목적지 IP 주소 |
iPort | 목적지 포트 번호 |
bool UdpSend | ( | Socket | iFd, |
const char * | pszBuf, | ||
int | iBufLen, | ||
unsigned int | iIp, | ||
unsigned short | iPort | ||
) |
IPv4 로 UDP 메시지를 전송한다.
iFd | 소캣 핸들 |
pszBuf | 발신 버퍼 |
iBufLen | 발신 버퍼 길이 |
iIp | 목적지 IP 주소 |
iPort | 목적지 포트 번호 |
bool UdpSend | ( | Socket | iFd, |
const char * | pszBuf, | ||
int | iBufLen, | ||
IN6_ADDR * | psttIp, | ||
unsigned short | iPort | ||
) |
IPv6 로 UDP 메시지를 전송한다.
iFd | 소캣 핸들 |
pszBuf | 발신 버퍼 |
iBufLen | 발신 버퍼 길이 |
psttIp | 목적지 IP 주소 |
iPort | 목적지 포트 번호 |
Socket UdpSocket | ( | bool | bIpv6 | ) |
UDP 소켓을 생성한다.
bIpv6 | IPv6 소켓을 생성할 것인가? |
bool CSipMutexSignal::wait | ( | ) |
signal 또는 broadcast 메소드가 호출될 때까지 대기한다.
CSipMutex::~CSipMutex | ( | ) |
소멸자
CSipMutexSignal::~CSipMutexSignal | ( | ) |
소멸자