mirror of
https://github.com/lifegpc/c-utils.git
synced 2026-06-06 21:28:50 +08:00
25 lines
620 B
C++
25 lines
620 B
C++
#ifndef _UTILS_CPP2C_H
|
|
#define _UTILS_CPP2C_H
|
|
|
|
#include <string>
|
|
#include <wchar.h>
|
|
|
|
namespace cpp2c {
|
|
/**
|
|
* @brief Convert string to char*
|
|
* @param inp Input string.
|
|
* @param out The pointer to output buffer. Need free memory by using free.
|
|
* @return true if succeeded.
|
|
*/
|
|
bool string2char(std::string inp, char*& out);
|
|
/**
|
|
* @brief Convert wstring to wchar_t*
|
|
* @param inp Input string
|
|
* @param out The pointer to output buffer. Need free memory by using free.
|
|
* @return true if succeeded.
|
|
*/
|
|
bool string2char(std::wstring inp, wchar_t*& out);
|
|
}
|
|
|
|
#endif
|