[sword-cvs] icu-sword/source/samples/datefmt/answers main_0.cpp,NONE,1.1 main_1.cpp,1.2,1.3 main_2.cpp,1.2,1.3 main_3.cpp,1.2,1.3
sword@www.crosswire.org
sword@www.crosswire.org
Tue, 9 Sep 2003 19:43:01 -0700
- Previous message: [sword-cvs] icu-sword/source/tools/genrb .cvsignore,1.2,1.3 Makefile.in,1.2,1.3 derb.1.in,NONE,1.1 derb.c,NONE,1.1 derb.dsp,NONE,1.1 derb.vcproj,NONE,1.1 errmsg.c,NONE,1.1 errmsg.h,NONE,1.1 genrb.1.in,NONE,1.1 genrb.c,1.3,1.4 genrb.dsp,1.2,1.3 genrb.h,NONE,1.1 genrb.vcproj,NONE,1.1 genrbjar.pl,NONE,1.1 parse.c,1.4,1.5 parse.h,1.2,1.3 read.c,1.3,1.4 read.h,1.2,1.3 reslist.c,1.3,1.4 reslist.h,1.3,1.4 rle.c,NONE,1.1 rle.h,NONE,1.1 ustr.c,1.2,1.3 ustr.h,1.2,1.3 util.c,1.2,1.3 util.h,1.2,1.3 wrtjava.c,NONE,1.1 wrtxml.c,NONE,1.1
- Next message: [sword-cvs] icu-sword/source/samples/datefmt Makefile,1.2,1.3 README.TXT,1.2,1.3 datefmt.dsp,1.3,1.4 datefmt.dsw,1.2,1.3 datefmt.sln,NONE,1.1 datefmt.vcproj,NONE,1.1 main.cpp,1.3,1.4 util.cpp,1.2,1.3 util.h,1.2,1.3
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /usr/local/cvsroot/icu-sword/source/samples/datefmt/answers
In directory www:/tmp/cvs-serv19862/source/samples/datefmt/answers
Added Files:
main_0.cpp main_1.cpp main_2.cpp main_3.cpp
Log Message:
ICU 2.6 commit
--- NEW FILE: main_0.cpp ---
/********************************************************************
* COPYRIGHT:
* Copyright (c) 1999-2003, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
#include "unicode/unistr.h"
#include "unicode/calendar.h"
#include "unicode/datefmt.h"
#include "unicode/uclean.h"
#include <stdio.h>
#include <stdlib.h>
#include "util.h"
/**
* If the ID supplied to TimeZone is not a valid system ID,
* TimeZone::createTimeZone() will return a GMT zone object. In order
* to detect this error, we check the ID of the returned zone against
* the ID we requested. If they don't match, we fail with an error.
*/
TimeZone* createZone(const UnicodeString& id) {
UnicodeString str;
TimeZone* zone = TimeZone::createTimeZone(id);
if (zone->getID(str) != id) {
delete zone;
printf("Error: TimeZone::createTimeZone(");
uprintf(id);
printf(") returned zone with ID ");
uprintf(str);
printf("\n");
exit(1);
}
return zone;
}
int main(int argc, char **argv) {
UErrorCode status = U_ZERO_ERROR;
UnicodeString str;
// The languages in which we will display the date
static char* LANGUAGE[] = {
"en", "de", "fr"
};
static const int32_t N_LANGUAGE = sizeof(LANGUAGE)/sizeof(LANGUAGE[0]);
// The time zones in which we will display the time
static char* TIMEZONE[] = {
"America/Los_Angeles",
"America/New_York",
"Europe/Paris",
"Europe/Berlin"
};
static const int32_t N_TIMEZONE = sizeof(TIMEZONE)/sizeof(TIMEZONE[0]);
for (int32_t i=0; i<N_LANGUAGE; ++i) {
Locale loc(LANGUAGE[i]);
// Display the formatted date string
printf("Date (%s)\n", LANGUAGE[i]);
}
printf("Exiting successfully\n");
u_cleanup();
return 0;
}
- Previous message: [sword-cvs] icu-sword/source/tools/genrb .cvsignore,1.2,1.3 Makefile.in,1.2,1.3 derb.1.in,NONE,1.1 derb.c,NONE,1.1 derb.dsp,NONE,1.1 derb.vcproj,NONE,1.1 errmsg.c,NONE,1.1 errmsg.h,NONE,1.1 genrb.1.in,NONE,1.1 genrb.c,1.3,1.4 genrb.dsp,1.2,1.3 genrb.h,NONE,1.1 genrb.vcproj,NONE,1.1 genrbjar.pl,NONE,1.1 parse.c,1.4,1.5 parse.h,1.2,1.3 read.c,1.3,1.4 read.h,1.2,1.3 reslist.c,1.3,1.4 reslist.h,1.3,1.4 rle.c,NONE,1.1 rle.h,NONE,1.1 ustr.c,1.2,1.3 ustr.h,1.2,1.3 util.c,1.2,1.3 util.h,1.2,1.3 wrtjava.c,NONE,1.1 wrtxml.c,NONE,1.1
- Next message: [sword-cvs] icu-sword/source/samples/datefmt Makefile,1.2,1.3 README.TXT,1.2,1.3 datefmt.dsp,1.3,1.4 datefmt.dsw,1.2,1.3 datefmt.sln,NONE,1.1 datefmt.vcproj,NONE,1.1 main.cpp,1.3,1.4 util.cpp,1.2,1.3 util.h,1.2,1.3
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]