You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ab...@locus.apache.org on 2000/01/06 00:30:38 UTC
cvs commit: xml-xerces/c/src/util/Transcoders/Iconv IconvTransService.cpp IconvTransService.hpp
abagchi 00/01/05 15:30:38
Modified: c/src/util/Transcoders/Iconv IconvTransService.cpp
IconvTransService.hpp
Log:
Fixed the new class IconvLCPTranscoder functions. Tested on Linux only.
Revision Changes Path
1.7 +10 -72 xml-xerces/c/src/util/Transcoders/Iconv/IconvTransService.cpp
Index: IconvTransService.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/util/Transcoders/Iconv/IconvTransService.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- IconvTransService.cpp 1999/12/18 00:22:32 1.6
+++ IconvTransService.cpp 2000/01/05 23:30:38 1.7
@@ -56,6 +56,9 @@
/**
* $Log: IconvTransService.cpp,v $
+ * Revision 1.7 2000/01/05 23:30:38 abagchi
+ * Fixed the new class IconvLCPTranscoder functions. Tested on Linux only.
+ *
* Revision 1.6 1999/12/18 00:22:32 roddey
* Changes to support the new, completely orthagonal, transcoder architecture.
*
@@ -188,7 +191,7 @@
}
-XMLTranscoder* IconvTransService::makeNewLCPTranscoder()
+XMLLCPTranscoder* IconvTransService::makeNewLCPTranscoder()
{
// Just allocate a new transcoder of our type
return new IconvLCPTranscoder;
@@ -214,23 +217,14 @@
resValue = XMLTransService::UnsupportedEncoding;
return 0;
}
-
-
-// ---------------------------------------------------------------------------
-// IconvLCPTranscoder: Constructors and Destructor
-// ---------------------------------------------------------------------------
-IconvLCPTranscoder::IconvLCPTranscoder()
+void IconvTransService::upperCase(XMLCh* const toUpperCase) const
{
+ towuppert(*toUpperCase);
}
-IconvLCPTranscoder::~IconvLCPTranscoder()
-{
-}
-
-
// ---------------------------------------------------------------------------
-// IconvTranscoder: The virtual transcoder API
+// IconvLCPTranscoder: The virtual transcoder API
// ---------------------------------------------------------------------------
unsigned int IconvLCPTranscoder::calcRequiredSize(const char* const srcText)
{
@@ -449,70 +443,14 @@
-// ---------------------------------------------------------------------------
-// IconvTranscoder: Constructors and Destructor
// ---------------------------------------------------------------------------
-IconvTranscoder::IconvTranscoder()
-{
-}
-
-IconvTranscoder::~IconvTranscoder()
-{
-}
-
-
-// ---------------------------------------------------------------------------
-// IconvTranscoder: Implementation of the virtual transcoder API
+// IconvLCPTranscoder: Constructors and Destructor
// ---------------------------------------------------------------------------
-XMLCh IconvTranscoder::transcodeOne(const char* const srcData
- , const unsigned int srcBytes
- , unsigned int& bytesEaten)
+IconvLCPTranscoder::IconvLCPTranscoder()
{
- wchar_t toFill;
- int eaten = ::mbtowc(&toFill, srcData, srcBytes);
- if (eaten == -1)
- {
- bytesEaten = 0;
- return 0;
- }
-
- // Return the bytes we ate and the resulting char.
- bytesEaten = eaten;
- return toFill;
}
-
-unsigned int
-IconvTranscoder::transcodeXML( const char* const srcData
- , const unsigned int srcCount
- , XMLCh* const toFill
- , const unsigned int maxChars
- , unsigned int& bytesEaten)
+IconvLCPTranscoder::~IconvLCPTranscoder()
{
- //
- // For this one, because we have to maintain the offset table, we have
- // to do them one char at a time until we run out of source data.
- //
- unsigned int countIn = 0;
- unsigned int countOut = 0;
- while (countOut < maxChars)
- {
- wchar_t oneWideChar;
- const int bytesEaten =
- ::mbtowc(&oneWideChar, &srcData[countIn], srcCount - countIn);
-
- // We are done, so break out
- if (bytesEaten == -1)
- break;
- toFill[countOut] = (XMLCh) oneWideChar;
- countIn += (unsigned int) bytesEaten;
- countOut++;
- }
-
- // Give back the counts of eaten and transcoded
- bytesEaten = countIn;
- return countOut;
}
-
-
1.3 +7 -3 xml-xerces/c/src/util/Transcoders/Iconv/IconvTransService.hpp
Index: IconvTransService.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/util/Transcoders/Iconv/IconvTransService.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- IconvTransService.hpp 1999/12/18 00:22:32 1.2
+++ IconvTransService.hpp 2000/01/05 23:30:38 1.3
@@ -56,6 +56,9 @@
/**
* $Log: IconvTransService.hpp,v $
+ * Revision 1.3 2000/01/05 23:30:38 abagchi
+ * Fixed the new class IconvLCPTranscoder functions. Tested on Linux only.
+ *
* Revision 1.2 1999/12/18 00:22:32 roddey
* Changes to support the new, completely orthagonal, transcoder architecture.
*
@@ -100,8 +103,9 @@
virtual bool isSpace(const XMLCh toCheck) const;
- virtual XMLTranscoder* makeNewLCPTranscoder();
+ virtual XMLLCPTranscoder* makeNewLCPTranscoder();
+ virtual void upperCase(XMLCh* const toUpperCase) const;
protected :
// -----------------------------------------------------------------------
@@ -172,8 +176,8 @@
// -----------------------------------------------------------------------
// Constructors and Destructor
// -----------------------------------------------------------------------
- IconvTranscoder();
- ~IconvTranscoder();
+ IconvLCPTranscoder();
+ ~IconvLCPTranscoder();
// -----------------------------------------------------------------------
Re: cvs commit: xml-xerces/c/src/util/Transcoders/Iconv
IconvTransService.cpp IconvTransService.hpp
Posted by Michael Mason <mg...@decisionsoft.com>.
abagchi@locus.apache.org wrote:
>
> abagchi 00/01/05 15:30:38
>
> Modified: c/src/util/Transcoders/Iconv IconvTransService.cpp
> IconvTransService.hpp
> Log:
> Fixed the new class IconvLCPTranscoder functions. Tested on Linux only.
>
Looks good -- they compile fine now, thanks. There are link problems,
though (see below the DOMString stuff).
Unfortunately, some of the other new stuff seems broken. I'm getting
/home/local/mgm/hacking/xerces-cvs/xml-xerces/c/src/internal
[mgm@tugela internal]$ make
mkdir -p
/home/local/mgm/hacking/xerces-cvs/xml-xerces/c/include/internal
cp -fp CharTypeTables.hpp ElemStack.hpp EndOfEntityException.hpp
MemBufInputSource.hpp ReaderMgr.hpp StdInInputSource.hpp
URLInputSource.hpp VecAttrListImpl.hpp XMLReader.hpp XMLScanner.hpp
/home/local/mgm/hacking/xerces-cvs/xml-xerces/c/include/internal
g++ -fpic -instances=static -DLINUX -D_REENTRANT -c -O
-DXML_USE_NATIVE_TRANSCODER -DXML_USE_INMEM_MESSAGELOADER
-I/home/local/mgm/hacking/xerces-cvs/xml-xerces/c/include -o
XMLReader.o XMLReader.cpp
XMLReader.cpp:86: util/XMLEBCDICTranscoder.hpp: No such file or
directory
make: *** [XMLReader.o] Error 1
Copying c/src/util/XMLEBCDICTranscoder.hpp to c/include/util fixes this
and allows it to compile. (Should it be copied as part of the make
process?)
Secondly, size_t wasn't known about in src/dom/DOMStringImpl.hpp. I
haven't looked too closely at why this is, exactly, but including
<cstddef> fixes it:
Index: src/dom/DOMStringImpl.hpp
===================================================================
RCS file: /home/cvspublic/xml-xerces/c/src/dom/DOMStringImpl.hpp,v
retrieving revision 1.1
diff -u -r1.1 DOMStringImpl.hpp
--- DOMStringImpl.hpp 2000/01/05 22:16:26 1.1
+++ DOMStringImpl.hpp 2000/01/06 10:32:46
@@ -76,7 +76,7 @@
#include <util/XML4CDefs.hpp>
-
+#include <cstddef>
class DOMStringData
{
Everything compiles like this, but when I link to the shared library I
get this lot:
libxerces-c1_0-linux.so: undefined reference to `XMLTransService
type_info node'
libxerces-c1_0-linux.so: undefined reference to
`XMLLCPTranscoder::XMLLCPTranscoder(void)'
libxerces-c1_0-linux.so: undefined reference to `XMLTransService
type_info function'
libxerces-c1_0-linux.so: undefined reference to
`XMLTransService::initTransService(void)'
libxerces-c1_0-linux.so: undefined reference to
`XMLTranscoder::XMLTranscoder(unsigned short const *, unsigned int)'
libxerces-c1_0-linux.so: undefined reference to `XMLLCPTranscoder
type_info node'
libxerces-c1_0-linux.so: undefined reference to
`XMLTransService::makeNewTranscoderFor(unsigned short const *,
XMLTransService::Codes &, unsigned int)'
libxerces-c1_0-linux.so: undefined reference to `XMLTranscoder type_info
function'
libxerces-c1_0-linux.so: undefined reference to
`XMLEBCDICTranscoder::xlatThisOne(unsigned char)'
libxerces-c1_0-linux.so: undefined reference to `XMLTranscoder type_info
node'
libxerces-c1_0-linux.so: undefined reference to
`XMLTranscoder::~XMLTranscoder(void)'
libxerces-c1_0-linux.so: undefined reference to
`XMLTransService::XMLTransService(void)'
libxerces-c1_0-linux.so: undefined reference to `XMLLCPTranscoder
type_info function'
libxerces-c1_0-linux.so: undefined reference to
`XMLTransService::~XMLTransService(void)'
libxerces-c1_0-linux.so: undefined reference to
`XMLLCPTranscoder::~XMLLCPTranscoder(void)'
I'm afraid I don't have time to do anything more productive than report
these problems right now -- I will try and have a look early next week
if no-one comes up with anything by then.
Cheers,
Mike.
--
Mike Mason, Software Engineer
XML Script Development Team Office: 44-1865-203192
http://www.xmlscript.org/ Mobile: 44-7050-288923