Use U8String/U16String/WString instead of UTF8String/UTF16String/WideString
This commit is contained in:
parent
1727440211
commit
ddf1bb4d0f
@ -84,7 +84,7 @@ enum class DataSourceType
|
|||||||
TwoPosition,
|
TwoPosition,
|
||||||
};
|
};
|
||||||
|
|
||||||
DataSourceType CheckDataSourceType(const UTF8String &str)
|
DataSourceType CheckDataSourceType(const U8String &str)
|
||||||
{
|
{
|
||||||
if(str.Length()<=11)return(DataSourceType::Error);
|
if(str.Length()<=11)return(DataSourceType::Error);
|
||||||
|
|
||||||
@ -99,7 +99,7 @@ DataSourceType CheckDataSourceType(const UTF8String &str)
|
|||||||
return(DataSourceType::Error);
|
return(DataSourceType::Error);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ParsePosition(Vector2i *result,const UTF8String &str)
|
bool ParsePosition(Vector2i *result,const U8String &str)
|
||||||
{
|
{
|
||||||
if(!result)return(false);
|
if(!result)return(false);
|
||||||
|
|
||||||
@ -149,7 +149,7 @@ struct LineSegment
|
|||||||
|
|
||||||
using LineSegmentData=List<LineSegment>;
|
using LineSegmentData=List<LineSegment>;
|
||||||
|
|
||||||
bool ParseLineSegment(LineSegment *result,const UTF8String &str)
|
bool ParseLineSegment(LineSegment *result,const U8String &str)
|
||||||
{
|
{
|
||||||
if(!result)return(false);
|
if(!result)return(false);
|
||||||
|
|
||||||
@ -189,7 +189,7 @@ bool ParseLineSegment(LineSegment *result,const UTF8String &str)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
void ParseStringList(List<T> &data_list,const UTF8StringList &sl,bool (*ParseLineFunc)(T *,const UTF8String &))
|
void ParseStringList(List<T> &data_list,const U8StringList &sl,bool (*ParseLineFunc)(T *,const U8String &))
|
||||||
{
|
{
|
||||||
const uint count=sl.GetCount();
|
const uint count=sl.GetCount();
|
||||||
|
|
||||||
@ -197,7 +197,7 @@ void ParseStringList(List<T> &data_list,const UTF8StringList &sl,bool (*ParseLin
|
|||||||
|
|
||||||
T *p=data_list.GetData();
|
T *p=data_list.GetData();
|
||||||
|
|
||||||
UTF8String str;
|
U8String str;
|
||||||
uint result=0;
|
uint result=0;
|
||||||
|
|
||||||
for(uint i=0;i<count;i++)
|
for(uint i=0;i<count;i++)
|
||||||
@ -596,7 +596,7 @@ int os_main(int argc,os_char **argv)
|
|||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
UTF8StringList sl;
|
U8StringList sl;
|
||||||
|
|
||||||
csv_filename=argv[1];
|
csv_filename=argv[1];
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
using namespace hgl;
|
using namespace hgl;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
void Output(UTF8StringList &sl,const char *str)
|
void Output(U8StringList &sl,const char *str)
|
||||||
{
|
{
|
||||||
cout<<str<<": ";
|
cout<<str<<": ";
|
||||||
|
|
||||||
@ -17,14 +17,14 @@ void Output(UTF8StringList &sl,const char *str)
|
|||||||
|
|
||||||
int main(int,char **)
|
int main(int,char **)
|
||||||
{
|
{
|
||||||
UTF8StringList sl;
|
U8StringList sl;
|
||||||
|
|
||||||
UTF8String str=u8"hello game world!";
|
U8String str=u8"hello game world!";
|
||||||
|
|
||||||
{
|
{
|
||||||
UTF8String left,right;
|
U8String left,right;
|
||||||
|
|
||||||
SpliteByString(str, UTF8String(u8"game"), &left, &right);
|
SpliteByString(str, U8String(u8"game"), &left, &right);
|
||||||
|
|
||||||
cout<<"SpliteByString"<<endl;
|
cout<<"SpliteByString"<<endl;
|
||||||
cout << "left: \"" <<(char *) left.c_str() <<"\"" << endl;
|
cout << "left: \"" <<(char *) left.c_str() <<"\"" << endl;
|
||||||
@ -87,7 +87,7 @@ int main(int,char **)
|
|||||||
str=u8"#include<hello.h>\n"
|
str=u8"#include<hello.h>\n"
|
||||||
"#include\"world.h\"\n";
|
"#include\"world.h\"\n";
|
||||||
|
|
||||||
SplitToStringListByChars(sl,str,UTF8String(u8"<>\"\n"));
|
SplitToStringListByChars(sl,str,U8String(u8"<>\"\n"));
|
||||||
|
|
||||||
Output(sl,"SplitToStringListByChars");
|
Output(sl,"SplitToStringListByChars");
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ int main(int,char **)
|
|||||||
|
|
||||||
ToDateTime(d,t,cur_time);
|
ToDateTime(d,t,cur_time);
|
||||||
|
|
||||||
UTF8String str=UTF8String::floatOf(cur_time,TIME_OUT_FRAC);
|
U8String str=U8String::floatOf(cur_time,TIME_OUT_FRAC);
|
||||||
|
|
||||||
cout<<"cur_time="<<str.c_str()<<endl;
|
cout<<"cur_time="<<str.c_str()<<endl;
|
||||||
cout<<"\tyear="<<d.GetYear()<<" month="<<d.GetMonth()<<" day="<<d.GetDay()<<endl;
|
cout<<"\tyear="<<d.GetYear()<<" month="<<d.GetMonth()<<" day="<<d.GetDay()<<endl;
|
||||||
@ -26,7 +26,7 @@ int main(int,char **)
|
|||||||
|
|
||||||
const double new_time=FromDateTime(d,t);
|
const double new_time=FromDateTime(d,t);
|
||||||
|
|
||||||
str=UTF8String::floatOf(new_time,TIME_OUT_FRAC);
|
str=U8String::floatOf(new_time,TIME_OUT_FRAC);
|
||||||
cout<<"new_time="<<str.c_str()<<endl;
|
cout<<"new_time="<<str.c_str()<<endl;
|
||||||
|
|
||||||
cout<<"TimeZone:"<<GetTimeZone()<<endl;
|
cout<<"TimeZone:"<<GetTimeZone()<<endl;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user