You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ro...@locus.apache.org on 2000/01/05 21:24:59 UTC
cvs commit: xml-xerces/c/tools/NLS/Xlat Xlat.cpp Xlat_CppSrc.cpp Xlat_CppSrc.hpp Xlat_Formatter.hpp Xlat_MsgCatalog.cpp Xlat_MsgCatalog.hpp Xlat_Win32RC.cpp Xlat_Win32RC.hpp
roddey 00/01/05 12:24:59
Modified: c/tools/NLS/Xlat Xlat.cpp Xlat_CppSrc.cpp Xlat_CppSrc.hpp
Xlat_Formatter.hpp Xlat_MsgCatalog.cpp
Xlat_MsgCatalog.hpp Xlat_Win32RC.cpp
Xlat_Win32RC.hpp
Log:
Some changes to simplify life for the Messge Catalog message loader. The formatter
for the message loader now spits out a simple header of ids that allows the loader to
be independent of hard coded set numbers.
Revision Changes Path
1.2 +8 -1 xml-xerces/c/tools/NLS/Xlat/Xlat.cpp
Index: Xlat.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/tools/NLS/Xlat/Xlat.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Xlat.cpp 1999/11/09 01:01:12 1.1
+++ Xlat.cpp 2000/01/05 20:24:58 1.2
@@ -57,9 +57,14 @@
/**
* $Log: Xlat.cpp,v $
- * Revision 1.1 1999/11/09 01:01:12 twl
- * Initial revision
+ * Revision 1.2 2000/01/05 20:24:58 roddey
+ * Some changes to simplify life for the Messge Catalog message loader. The formatter
+ * for the message loader now spits out a simple header of ids that allows the loader to
+ * be independent of hard coded set numbers.
*
+ * Revision 1.1.1.1 1999/11/09 01:01:12 twl
+ * Initial checkin
+ *
* Revision 1.5 1999/11/08 20:42:04 rahul
* Swat for adding in Product name and CVS comment log variable.
*
@@ -518,7 +523,11 @@
fwprintf(outHeader, L"class %s\n{\npublic :\n enum Codes\n {\n", errNameSpace);
// Tell the formatter that a new domain is starting
- formatter->startDomain(domainStr);
+ formatter->startDomain
+ (
+ domainStr
+ , errNameSpace
+ );
//
// Force out the first message, which is always implicit and is
1.2 +5 -1 xml-xerces/c/tools/NLS/Xlat/Xlat_CppSrc.cpp
Index: Xlat_CppSrc.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/tools/NLS/Xlat/Xlat_CppSrc.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Xlat_CppSrc.cpp 1999/11/09 01:01:16 1.1
+++ Xlat_CppSrc.cpp 2000/01/05 20:24:58 1.2
@@ -56,9 +56,14 @@
/**
* $Log: Xlat_CppSrc.cpp,v $
- * Revision 1.1 1999/11/09 01:01:16 twl
- * Initial revision
+ * Revision 1.2 2000/01/05 20:24:58 roddey
+ * Some changes to simplify life for the Messge Catalog message loader. The formatter
+ * for the message loader now spits out a simple header of ids that allows the loader to
+ * be independent of hard coded set numbers.
*
+ * Revision 1.1.1.1 1999/11/09 01:01:16 twl
+ * Initial checkin
+ *
* Revision 1.4 1999/11/08 20:42:05 rahul
* Swat for adding in Product name and CVS comment log variable.
*
@@ -144,7 +149,8 @@
}
-void CppSrcFormatter::startDomain(const XMLCh* const domainName)
+void CppSrcFormatter::startDomain( const XMLCh* const domainName
+ , const XMLCh* const)
{
//
// We have a different array name for each domain, so store that for
1.2 +8 -1 xml-xerces/c/tools/NLS/Xlat/Xlat_CppSrc.hpp
Index: Xlat_CppSrc.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/tools/NLS/Xlat/Xlat_CppSrc.hpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Xlat_CppSrc.hpp 1999/11/09 01:01:18 1.1
+++ Xlat_CppSrc.hpp 2000/01/05 20:24:58 1.2
@@ -56,9 +56,14 @@
/**
* $Log: Xlat_CppSrc.hpp,v $
- * Revision 1.1 1999/11/09 01:01:18 twl
- * Initial revision
+ * Revision 1.2 2000/01/05 20:24:58 roddey
+ * Some changes to simplify life for the Messge Catalog message loader. The formatter
+ * for the message loader now spits out a simple header of ids that allows the loader to
+ * be independent of hard coded set numbers.
*
+ * Revision 1.1.1.1 1999/11/09 01:01:18 twl
+ * Initial checkin
+ *
* Revision 1.2 1999/11/08 20:42:05 rahul
* Swat for adding in Product name and CVS comment log variable.
*
@@ -108,7 +113,11 @@
, const unsigned int curId
);
- virtual void startDomain(const XMLCh* const domainName);
+ virtual void startDomain
+ (
+ const XMLCh* const domainName
+ , const XMLCh* const nameSpace
+ );
virtual void startMsgType
(
1.2 +8 -1 xml-xerces/c/tools/NLS/Xlat/Xlat_Formatter.hpp
Index: Xlat_Formatter.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/tools/NLS/Xlat/Xlat_Formatter.hpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Xlat_Formatter.hpp 1999/11/09 01:01:22 1.1
+++ Xlat_Formatter.hpp 2000/01/05 20:24:58 1.2
@@ -56,9 +56,14 @@
/**
* $Log: Xlat_Formatter.hpp,v $
- * Revision 1.1 1999/11/09 01:01:22 twl
- * Initial revision
+ * Revision 1.2 2000/01/05 20:24:58 roddey
+ * Some changes to simplify life for the Messge Catalog message loader. The formatter
+ * for the message loader now spits out a simple header of ids that allows the loader to
+ * be independent of hard coded set numbers.
*
+ * Revision 1.1.1.1 1999/11/09 01:01:22 twl
+ * Initial checkin
+ *
* Revision 1.3 1999/11/08 20:42:06 rahul
* Swat for adding in Product name and CVS comment log variable.
*
@@ -105,7 +110,11 @@
, const unsigned int curId
) = 0;
- virtual void startDomain(const XMLCh* const domainName) = 0;
+ virtual void startDomain
+ (
+ const XMLCh* const domainName
+ , const XMLCh* const nameSpace
+ ) = 0;
virtual void startMsgType
(
1.3 +28 -25 xml-xerces/c/tools/NLS/Xlat/Xlat_MsgCatalog.cpp
Index: Xlat_MsgCatalog.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/tools/NLS/Xlat/Xlat_MsgCatalog.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Xlat_MsgCatalog.cpp 1999/12/20 22:51:09 1.2
+++ Xlat_MsgCatalog.cpp 2000/01/05 20:24:58 1.3
@@ -56,6 +56,11 @@
/**
* $Log: Xlat_MsgCatalog.cpp,v $
+ * Revision 1.3 2000/01/05 20:24:58 roddey
+ * Some changes to simplify life for the Messge Catalog message loader. The formatter
+ * for the message loader now spits out a simple header of ids that allows the loader to
+ * be independent of hard coded set numbers.
+ *
* Revision 1.2 1999/12/20 22:51:09 roddey
* Updated to deal with the new transcoder interface.
*
@@ -87,6 +92,9 @@
// Try to create a transcoder for the format that we were told
// to output in.
//
+ // <TBD> Right now we are just using an LCP transcoding, which is not
+ // really the right thing to do!
+ //
fTranscoder = XMLPlatformUtils::fgTransService->makeNewLCPTranscoder();
if (!fTranscoder)
{
@@ -117,8 +125,9 @@
void MsgCatFormatter::endOutput()
{
- // Close the output file
+ // Close the output files
fclose(fOutFl);
+ fclose(fOutHpp);
}
void
@@ -139,36 +148,20 @@
}
-void MsgCatFormatter::startDomain(const XMLCh* const domainName)
+void MsgCatFormatter::startDomain( const XMLCh* const domainName
+ , const XMLCh* const nameSpace)
{
- //
- // We need to output a different set id for each domain. So we look
- // for each one here and assign a set number.
- //
- unsigned int setNum;
- if (!XMLString::compareString(XMLUni::fgXMLErrDomain, domainName))
- {
- setNum = 1;
- }
- else if (!XMLString::compareString(XMLUni::fgExceptDomain, domainName))
- {
- setNum = 2;
- }
- else if (!XMLString::compareString(XMLUni::fgValidityDomain, domainName))
- {
- setNum = 3;
- }
- else
- {
- wprintf(L"Unknown message domain: %s\n", domainName);
- throw ErrReturn_SrcFmtError;
- }
+ // Output a constant to the header file
+ fwprintf(fOutHpp, L"const unsigned int CatId_%s = %d;\n", nameSpace, fSeqId);
//
// Output the leading part of the array declaration. Its just an
// array of pointers to Unicode chars.
//
- fwprintf(fOutFl, L"$set %u\n", setNum);
+ fwprintf(fOutFl, L"$set %u\n", fSeqId);
+
+ // And bump the sequence id
+ fSeqId++;
}
@@ -202,4 +195,16 @@
// Set the message delimiter
fwprintf(fOutFl, L"$quote \"\n");
+
+
+ swprintf(tmpBuf, L"%s/%s.hpp", outPath, L"XMLMsgCat_Ids");
+ fOutHpp = _wfopen(tmpBuf, L"wt");
+ if (!fOutHpp)
+ {
+ wprintf(L"Could not open the output file: %s\n\n", tmpBuf);
+ throw ErrReturn_OutFileOpenFailed;
+ }
+
+ // Reset the sequence id
+ fSeqId = 1;
}
1.3 +20 -2 xml-xerces/c/tools/NLS/Xlat/Xlat_MsgCatalog.hpp
Index: Xlat_MsgCatalog.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/tools/NLS/Xlat/Xlat_MsgCatalog.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Xlat_MsgCatalog.hpp 1999/12/20 22:51:09 1.2
+++ Xlat_MsgCatalog.hpp 2000/01/05 20:24:58 1.3
@@ -56,6 +56,11 @@
/**
* $Log: Xlat_MsgCatalog.hpp,v $
+ * Revision 1.3 2000/01/05 20:24:58 roddey
+ * Some changes to simplify life for the Messge Catalog message loader. The formatter
+ * for the message loader now spits out a simple header of ids that allows the loader to
+ * be independent of hard coded set numbers.
+ *
* Revision 1.2 1999/12/20 22:51:09 roddey
* Updated to deal with the new transcoder interface.
*
@@ -102,7 +107,11 @@
, const unsigned int curId
);
- virtual void startDomain(const XMLCh* const domainName);
+ virtual void startDomain
+ (
+ const XMLCh* const domainName
+ , const XMLCh* const nameSpace
+ );
virtual void startMsgType
(
@@ -128,12 +137,23 @@
// Private data members
//
// fOutFl
- // This is the current output file.
+ // This is the current output file for the message catalog contents.
+ //
+ // fOutHpp
+ // This is a separate header into which we just generate a couple
+ // of constants to make the message catalog loader independent of
+ // the order of the section numbers.
+ //
+ // fSeqId
+ // This is the number that we use to assign the sequence ids to
+ // each section we output to the message catalog.
//
// fTranscoder
// This is our transcoder. We transcode to the local code page in
// order to output Unicode based text to the message catalog.
// -----------------------------------------------------------------------
FILE* fOutFl;
+ FILE* fOutHpp;
+ unsigned int fSeqId;
XMLLCPTranscoder* fTranscoder;
};
1.2 +5 -1 xml-xerces/c/tools/NLS/Xlat/Xlat_Win32RC.cpp
Index: Xlat_Win32RC.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/tools/NLS/Xlat/Xlat_Win32RC.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Xlat_Win32RC.cpp 1999/11/09 01:01:30 1.1
+++ Xlat_Win32RC.cpp 2000/01/05 20:24:58 1.2
@@ -56,9 +56,14 @@
/**
* $Log: Xlat_Win32RC.cpp,v $
- * Revision 1.1 1999/11/09 01:01:30 twl
- * Initial revision
+ * Revision 1.2 2000/01/05 20:24:58 roddey
+ * Some changes to simplify life for the Messge Catalog message loader. The formatter
+ * for the message loader now spits out a simple header of ids that allows the loader to
+ * be independent of hard coded set numbers.
*
+ * Revision 1.1.1.1 1999/11/09 01:01:30 twl
+ * Initial checkin
+ *
* Revision 1.3 1999/11/08 20:42:07 rahul
* Swat for adding in Product name and CVS comment log variable.
*
@@ -132,7 +137,8 @@
}
-void Win32RCFormatter::startDomain(const XMLCh* const domainName)
+void Win32RCFormatter::startDomain( const XMLCh* const domainName
+ , const XMLCh* const)
{
//
// We have a different array name for each domain, so store that for
1.2 +8 -1 xml-xerces/c/tools/NLS/Xlat/Xlat_Win32RC.hpp
Index: Xlat_Win32RC.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/tools/NLS/Xlat/Xlat_Win32RC.hpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Xlat_Win32RC.hpp 1999/11/09 01:01:32 1.1
+++ Xlat_Win32RC.hpp 2000/01/05 20:24:58 1.2
@@ -56,9 +56,14 @@
/**
* $Log: Xlat_Win32RC.hpp,v $
- * Revision 1.1 1999/11/09 01:01:32 twl
- * Initial revision
+ * Revision 1.2 2000/01/05 20:24:58 roddey
+ * Some changes to simplify life for the Messge Catalog message loader. The formatter
+ * for the message loader now spits out a simple header of ids that allows the loader to
+ * be independent of hard coded set numbers.
*
+ * Revision 1.1.1.1 1999/11/09 01:01:32 twl
+ * Initial checkin
+ *
* Revision 1.2 1999/11/08 20:42:07 rahul
* Swat for adding in Product name and CVS comment log variable.
*
@@ -99,7 +104,11 @@
, const unsigned int curId
);
- virtual void startDomain(const XMLCh* const domainName);
+ virtual void startDomain
+ (
+ const XMLCh* const domainName
+ , const XMLCh* const nameSpace
+ );
virtual void startMsgType
(