本文整理汇总了C++中Locale::GetLanguageCodeString方法的典型用法代码示例。如果您正苦于以下问题:C++ Locale::GetLanguageCodeString方法的具体用法?C++ Locale::GetLanguageCodeString怎么用?C++ Locale::GetLanguageCodeString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Locale
的用法示例。
在下文中一共展示了Locale::GetLanguageCodeString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
TimeAndPlace::SetSiderialTime(float longitude, float latitude, DateTime* currTime) {
AppLog("Trying to access TimeAndPlace");
TimeAndPlace::SetLongitude(longitude);
AppLog("Trying to access TimeAndPlace 1");
TimeAndPlace::SetLatitude(latitude);
AppLog("Trying to access TimeAndPlace 2");
//TimeZone timeZone(60, L"Europe/London");
LocaleManager localeManager;
localeManager.Construct();
Locale locale = localeManager.GetSystemLocale();
TimeZone timeZone = localeManager.GetSystemTimeZone();
AppLog("Locale code %S", (locale.GetLanguageCodeString().GetPointer()));
AppLog("TimeZone ID is %S", (timeZone.GetId()).GetPointer());
// TimeZone timeZone(TimeZone::GetGmtTimeZone());
AppLog("TP1");
SystemTime::GetCurrentTime(*currTime);
AppLog("TP2");
dateTime = currTime;
AppLog("TP2a");
localDateTime = &(timeZone.UtcTimeToStandardTime(*currTime));
Calendar* calendar;
AppLog("TP3");
calendar = Calendar::CreateInstanceN(timeZone, CALENDAR_GREGORIAN);
AppLog("TP4");
calendar->SetTime(*currTime);
AppLog("TP5");
float hrs = (calendar->GetTimeField(TIME_FIELD_HOUR_OF_DAY))-1;
AppLog("TP6");
float minHrs = calendar->GetTimeField(TIME_FIELD_MINUTE)/60.0;
AppLog("TP7");
float dayFract = (hrs + minHrs)/24.0;
AppLog("TP8");
float dayNum = calendar->GetTimeField(TIME_FIELD_DAY_OF_YEAR);
AppLog("TP9");
float year = calendar->GetTimeField(TIME_FIELD_YEAR);
AppLog("TP10");
double daysSinceJ2000 = -1.5 + dayNum + (year-2000)*365 + (int)((year-2000)/4) + dayFract;
AppLog("TP11");
double slt = 100.46 + 0.985647 * daysSinceJ2000 + longitude + 15*(hrs + minHrs);
AppLog("TP12");
int sltInt = (int)(slt/360);
AppLog("TP13");
float sltHrs = (slt-(360*sltInt))/15;
AppLog("TP14");
SetSiderialTime (sltHrs);
AppLog("TP15");
}