You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
(25) |
Apr
(97) |
May
(56) |
Jun
(29) |
Jul
(65) |
Aug
(18) |
Sep
(14) |
Oct
(114) |
Nov
(12) |
Dec
(40) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(44) |
Feb
(47) |
Mar
(109) |
Apr
(114) |
May
(47) |
Jun
(36) |
Jul
(8) |
Aug
(23) |
Sep
(111) |
Oct
(64) |
Nov
(57) |
Dec
(26) |
2004 |
Jan
(2) |
Feb
(18) |
Mar
(11) |
Apr
(1) |
May
(52) |
Jun
(70) |
Jul
(37) |
Aug
(24) |
Sep
(4) |
Oct
(27) |
Nov
(4) |
Dec
(29) |
2005 |
Jan
(8) |
Feb
(36) |
Mar
(71) |
Apr
(31) |
May
(42) |
Jun
(2) |
Jul
(53) |
Aug
(43) |
Sep
(41) |
Oct
(55) |
Nov
(59) |
Dec
(51) |
2006 |
Jan
(36) |
Feb
(36) |
Mar
(19) |
Apr
(85) |
May
(33) |
Jun
(10) |
Jul
(110) |
Aug
(44) |
Sep
(10) |
Oct
(123) |
Nov
(27) |
Dec
|
2007 |
Jan
(34) |
Feb
(16) |
Mar
(21) |
Apr
(53) |
May
(6) |
Jun
(8) |
Jul
(117) |
Aug
(10) |
Sep
(131) |
Oct
(13) |
Nov
(8) |
Dec
(46) |
2008 |
Jan
(47) |
Feb
(44) |
Mar
(66) |
Apr
(2) |
May
(29) |
Jun
(37) |
Jul
(13) |
Aug
(22) |
Sep
(32) |
Oct
(55) |
Nov
(60) |
Dec
(108) |
2009 |
Jan
(23) |
Feb
(103) |
Mar
(98) |
Apr
(21) |
May
(78) |
Jun
(141) |
Jul
(130) |
Aug
(60) |
Sep
(56) |
Oct
(51) |
Nov
(26) |
Dec
(17) |
2010 |
Jan
(48) |
Feb
(49) |
Mar
(42) |
Apr
(123) |
May
(38) |
Jun
(89) |
Jul
(34) |
Aug
(64) |
Sep
(31) |
Oct
(113) |
Nov
(20) |
Dec
(104) |
2011 |
Jan
(110) |
Feb
(70) |
Mar
(43) |
Apr
(30) |
May
(48) |
Jun
(115) |
Jul
(186) |
Aug
(17) |
Sep
(69) |
Oct
(77) |
Nov
(25) |
Dec
(25) |
2012 |
Jan
(49) |
Feb
(9) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <ag...@us...> - 2011-12-08 08:26:35
|
Revision: 2636 http://zoolib.svn.sourceforge.net/zoolib/?rev=2636&view=rev Author: agreen Date: 2011-12-08 08:26:29 +0000 (Thu, 08 Dec 2011) Log Message: ----------- Use ZLOGPF. Modified Paths: -------------- trunk/zoolib/source/cxx/zoolib/ZUtil_CarbonEvents.cpp Modified: trunk/zoolib/source/cxx/zoolib/ZUtil_CarbonEvents.cpp =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZUtil_CarbonEvents.cpp 2011-12-06 00:44:34 UTC (rev 2635) +++ trunk/zoolib/source/cxx/zoolib/ZUtil_CarbonEvents.cpp 2011-12-08 08:26:29 UTC (rev 2636) @@ -32,10 +32,10 @@ using std::string; -#if !defined(UNIVERSAL_INTERFACES_VERSION) || UNIVERSAL_INTERFACES_VERSION <= 0x0341 +#if defined(UNIVERSAL_INTERFACES_VERSION) && UNIVERSAL_INTERFACES_VERSION > 0x0341 + #define USING_ANCIENT_HEADERS 0 +#else #define USING_ANCIENT_HEADERS 1 -#else - #define USING_ANCIENT_HEADERS 0 #endif // ================================================================================================= @@ -68,7 +68,7 @@ #pragma mark - #pragma mark * Handler -namespace { +namespace { // anonymous using namespace ZUtil_CarbonEvents; @@ -158,13 +158,13 @@ } catch (std::exception& ex) { - if (ZLOG(s, eNotice, "Handler")) - s << "spEventHandler, uncaught exception: " << ex.what(); + if (ZLOGPF(s, eNotice)) + s << "Uncaught exception: " << ex.what(); } catch (...) { - if (ZLOG(s, eNotice, "Handler")) - s << "spEventHandler, uncaught exception, not derived fron std::exception"; + if (ZLOGPF(s, eNotice)) + s << "uncaught exception, not derived fron std::exception"; } return noErr; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2011-12-06 00:44:40
|
Revision: 2635 http://zoolib.svn.sourceforge.net/zoolib/?rev=2635&view=rev Author: agreen Date: 2011-12-06 00:44:34 +0000 (Tue, 06 Dec 2011) Log Message: ----------- Handle ZWNBSP (byte-order mark) better. Modified Paths: -------------- trunk/zoolib/source/cxx/zoolib/ZUtil_Strim.cpp Modified: trunk/zoolib/source/cxx/zoolib/ZUtil_Strim.cpp =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZUtil_Strim.cpp 2011-12-03 23:40:11 UTC (rev 2634) +++ trunk/zoolib/source/cxx/zoolib/ZUtil_Strim.cpp 2011-12-06 00:44:34 UTC (rev 2635) @@ -38,6 +38,17 @@ #pragma mark - #pragma mark * ZUtil_Strim +static bool spIsWhitespace(UTF32 iCP) + { + if (ZUnicode::sIsWhitespace(iCP)) + return true; + + if (iCP == 0xFEFF) + return true; + + return false; + } + bool sTryRead_CP(const ZStrimU& iStrimU, UTF32 iCP) { // Ensure that we only try to read a valid CP, one that @@ -383,7 +394,7 @@ UTF32 theCP; if (not iStrimU.ReadCP(theCP)) break; - if (not ZUnicode::sIsWhitespace(theCP)) + if (not spIsWhitespace(theCP)) { iStrimU.Unread(theCP); break; @@ -399,7 +410,7 @@ UTF32 theCP; if (not iStrimU.ReadCP(theCP)) break; - if (not ZUnicode::sIsWhitespace(theCP)) + if (not spIsWhitespace(theCP)) { iStrimU.Unread(theCP); break; @@ -418,7 +429,7 @@ UTF32 firstCP; if (iStrimU.ReadCP(firstCP)) { - if (ZUnicode::sIsWhitespace(firstCP)) + if (spIsWhitespace(firstCP)) { oDest.WriteCP(firstCP); continue; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2011-12-03 23:40:17
|
Revision: 2634 http://zoolib.svn.sourceforge.net/zoolib/?rev=2634&view=rev Author: agreen Date: 2011-12-03 23:40:11 +0000 (Sat, 03 Dec 2011) Log Message: ----------- Anoother wchar_t situation. Modified Paths: -------------- trunk/zoolib/source/cxx/zoolib/ZUtil_Strim_Operators.cpp trunk/zoolib/source/cxx/zoolib/ZUtil_Strim_Operators.h Modified: trunk/zoolib/source/cxx/zoolib/ZUtil_Strim_Operators.cpp =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZUtil_Strim_Operators.cpp 2011-12-03 23:10:50 UTC (rev 2633) +++ trunk/zoolib/source/cxx/zoolib/ZUtil_Strim_Operators.cpp 2011-12-03 23:40:11 UTC (rev 2634) @@ -65,7 +65,7 @@ const ZStrimW& operator<<(const ZStrimW& s, signed char iVal) { return s.Writef("%c", iVal); } -const ZStrimW& operator<<(const ZStrimW& s, wchar_t iVal) +const ZStrimW& operator<<(const ZStrimW& s, __wchar_t iVal) { return s.Writef("%lc", iVal); } const ZStrimW& operator<<(const ZStrimW& s, short iVal) Modified: trunk/zoolib/source/cxx/zoolib/ZUtil_Strim_Operators.h =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZUtil_Strim_Operators.h 2011-12-03 23:10:50 UTC (rev 2633) +++ trunk/zoolib/source/cxx/zoolib/ZUtil_Strim_Operators.h 2011-12-03 23:40:11 UTC (rev 2634) @@ -45,7 +45,7 @@ const ZStrimW& operator<<(const ZStrimW& s, char iVal); const ZStrimW& operator<<(const ZStrimW& s, unsigned char iVal); const ZStrimW& operator<<(const ZStrimW& s, signed char iVal); -const ZStrimW& operator<<(const ZStrimW& s, wchar_t iVal); +const ZStrimW& operator<<(const ZStrimW& s, __wchar_t iVal); const ZStrimW& operator<<(const ZStrimW& s, short iVal); const ZStrimW& operator<<(const ZStrimW& s, unsigned short iVal); const ZStrimW& operator<<(const ZStrimW& s, int iVal); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2011-12-03 23:10:57
|
Revision: 2633 http://zoolib.svn.sourceforge.net/zoolib/?rev=2633&view=rev Author: agreen Date: 2011-12-03 23:10:50 +0000 (Sat, 03 Dec 2011) Log Message: ----------- Get conditional compilation and namespace close in the correct order. Modified Paths: -------------- trunk/zoolib/source/cxx/zoolib/ZStream_CFStream.cpp Modified: trunk/zoolib/source/cxx/zoolib/ZStream_CFStream.cpp =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZStream_CFStream.cpp 2011-12-03 23:10:27 UTC (rev 2632) +++ trunk/zoolib/source/cxx/zoolib/ZStream_CFStream.cpp 2011-12-03 23:10:50 UTC (rev 2633) @@ -82,6 +82,6 @@ } } +} // namespace ZooLib + #endif // ZCONFIG_SPI_Enabled(CoreFoundation) - -} // namespace ZooLib This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2011-12-03 23:10:33
|
Revision: 2632 http://zoolib.svn.sourceforge.net/zoolib/?rev=2632&view=rev Author: agreen Date: 2011-12-03 23:10:27 +0000 (Sat, 03 Dec 2011) Log Message: ----------- __wchar_t thing. Modified Paths: -------------- trunk/zoolib/source/cxx/zoolib/ZCompare_Integer.cpp Modified: trunk/zoolib/source/cxx/zoolib/ZCompare_Integer.cpp =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZCompare_Integer.cpp 2011-12-03 23:09:52 UTC (rev 2631) +++ trunk/zoolib/source/cxx/zoolib/ZCompare_Integer.cpp 2011-12-03 23:10:27 UTC (rev 2632) @@ -27,7 +27,7 @@ ZMACRO_CompareRegistration_T(char) ZMACRO_CompareRegistration_T(unsigned char) ZMACRO_CompareRegistration_T(signed char) -ZMACRO_CompareRegistration_T(wchar_t) +ZMACRO_CompareRegistration_T(__wchar_t) ZMACRO_CompareRegistration_T(short) ZMACRO_CompareRegistration_T(unsigned short) ZMACRO_CompareRegistration_T(int) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2011-12-03 23:09:58
|
Revision: 2631 http://zoolib.svn.sourceforge.net/zoolib/?rev=2631&view=rev Author: agreen Date: 2011-12-03 23:09:52 +0000 (Sat, 03 Dec 2011) Log Message: ----------- Seqs look better with commas. Modified Paths: -------------- trunk/zoolib/source/cxx/zoolib/ZYad_JSON.cpp Modified: trunk/zoolib/source/cxx/zoolib/ZYad_JSON.cpp =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZYad_JSON.cpp 2011-12-03 23:09:26 UTC (rev 2630) +++ trunk/zoolib/source/cxx/zoolib/ZYad_JSON.cpp 2011-12-03 23:09:52 UTC (rev 2631) @@ -742,7 +742,7 @@ { break; } - else if (fOptions.fUseExtendedNotation.DGet(false)) + else if (false && fOptions.fUseExtendedNotation.DGet(false)) { spWriteLFIndent(fStrimW, fIndent, fOptions); cur->Accept(*this); @@ -770,7 +770,7 @@ { break; } - else if (fOptions.fUseExtendedNotation.DGet(false)) + else if (false && fOptions.fUseExtendedNotation.DGet(false)) { if (not isFirst && fOptions.fBreakStrings) fStrimW.Write(" "); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2011-12-03 23:09:32
|
Revision: 2630 http://zoolib.svn.sourceforge.net/zoolib/?rev=2630&view=rev Author: agreen Date: 2011-12-03 23:09:26 +0000 (Sat, 03 Dec 2011) Log Message: ----------- Use __wchar_t, so when we're on VC++ without a native wchar_t things still work. Modified Paths: -------------- trunk/zoolib/source/cxx/zoolib/ZCompare_Integer.h Modified: trunk/zoolib/source/cxx/zoolib/ZCompare_Integer.h =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZCompare_Integer.h 2011-12-03 23:08:57 UTC (rev 2629) +++ trunk/zoolib/source/cxx/zoolib/ZCompare_Integer.h 2011-12-03 23:09:26 UTC (rev 2630) @@ -45,7 +45,7 @@ template <> -inline int sCompare_T(const wchar_t& iL, const wchar_t& iR) +inline int sCompare_T(const __wchar_t& iL, const __wchar_t& iR) { return iL < iR ? -1 : iR < iL ? 1 : 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2011-12-03 23:09:03
|
Revision: 2629 http://zoolib.svn.sourceforge.net/zoolib/?rev=2629&view=rev Author: agreen Date: 2011-12-03 23:08:57 +0000 (Sat, 03 Dec 2011) Log Message: ----------- Define __wchar_t when we're not on VC++, so we can use __wchar_t when we *are* on VC++ Modified Paths: -------------- trunk/zoolib/source/cxx/zoolib/zconfigl.h Modified: trunk/zoolib/source/cxx/zoolib/zconfigl.h =================================================================== --- trunk/zoolib/source/cxx/zoolib/zconfigl.h 2011-11-30 15:00:45 UTC (rev 2628) +++ trunk/zoolib/source/cxx/zoolib/zconfigl.h 2011-12-03 23:08:57 UTC (rev 2629) @@ -254,7 +254,10 @@ // inherits 'XXX' via dominance # pragma warning(disable:4250) +#else + typedef wchar_t __wchar_t; + #endif // ================================================================================================= This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2011-11-30 15:00:53
|
Revision: 2628 http://zoolib.svn.sourceforge.net/zoolib/?rev=2628&view=rev Author: agreen Date: 2011-11-30 15:00:45 +0000 (Wed, 30 Nov 2011) Log Message: ----------- Various tweaks to remove warnings. Modified Paths: -------------- trunk/zoolib/source/cxx/zoolib/ZBitStream.cpp trunk/zoolib/source/cxx/zoolib/ZDCFont.cpp trunk/zoolib/source/cxx/zoolib/ZDCPixmapCoder_BMP.cpp trunk/zoolib/source/cxx/zoolib/ZDCPixmapNS.cpp trunk/zoolib/source/cxx/zoolib/ZIntervalTreeClock.cpp trunk/zoolib/source/cxx/zoolib/ZMIME.cpp trunk/zoolib/source/cxx/zoolib/ZML.cpp trunk/zoolib/source/cxx/zoolib/ZNet.cpp trunk/zoolib/source/cxx/zoolib/ZNet_Internet.cpp trunk/zoolib/source/cxx/zoolib/ZNet_Internet_MacOT_OSX.cpp trunk/zoolib/source/cxx/zoolib/ZStream.cpp trunk/zoolib/source/cxx/zoolib/ZStreamRW_FlushOnRead.cpp trunk/zoolib/source/cxx/zoolib/ZStreamW_HexStrim.cpp trunk/zoolib/source/cxx/zoolib/ZStream_CGData.cpp trunk/zoolib/source/cxx/zoolib/ZStream_Data_T.h trunk/zoolib/source/cxx/zoolib/ZStream_LZW.cpp trunk/zoolib/source/cxx/zoolib/ZStream_Memory.cpp trunk/zoolib/source/cxx/zoolib/ZTxn.cpp trunk/zoolib/source/cxx/zoolib/ZUSB_OSX.cpp trunk/zoolib/source/cxx/zoolib/ZVal_AppleEvent.cpp trunk/zoolib/source/cxx/zoolib/ZVal_NS.mm trunk/zoolib/source/cxx/zoolib/ZYad_DividedValues.cpp trunk/zoolib/source/cxx/zoolib/ZYad_ML.cpp trunk/zoolib/source/cxx/zoolib/ZYad_XMLPList.cpp Modified: trunk/zoolib/source/cxx/zoolib/ZBitStream.cpp =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZBitStream.cpp 2011-11-30 15:00:03 UTC (rev 2627) +++ trunk/zoolib/source/cxx/zoolib/ZBitStream.cpp 2011-11-30 15:00:45 UTC (rev 2628) @@ -209,7 +209,7 @@ bool ZBitWriterBE::WriteBits(const ZStreamW& iStream, size_t iCountBits, uint32 iBits) { ZAssertStop(kDebug_BitStream, iCountBits <= 32); - ZAssertStop(kDebug_BitStream, iBits < (1 << iCountBits)); + ZAssertStop(kDebug_BitStream, iBits < (1U << iCountBits)); while (iCountBits) { if (fAvailBits == 0) @@ -243,7 +243,7 @@ (void* oDest, size_t iCountBits, uint32 iBits, size_t* oCountBytesWritten) { ZAssertStop(kDebug_BitStream, iCountBits <= 32); - ZAssertStop(kDebug_BitStream, iBits < (1 << iCountBits)); + ZAssertStop(kDebug_BitStream, iBits < (1U << iCountBits)); uint8* localDest = static_cast<uint8*>(oDest); while (iCountBits) @@ -317,7 +317,7 @@ bool ZBitWriterLE::WriteBits(const ZStreamW& iStream, size_t iCountBits, uint32 iBits) { ZAssertStop(kDebug_BitStream, iCountBits <= 32); - ZAssertStop(kDebug_BitStream, iBits < (1 << iCountBits)); + ZAssertStop(kDebug_BitStream, iBits < (1U << iCountBits)); while (iCountBits--) { if (fAvailBits-- == 0) @@ -346,7 +346,7 @@ (void* oDest, size_t iCountBits, uint32 iBits, size_t* oCountBytesWritten) { ZAssertStop(kDebug_BitStream, iCountBits <= 32); - ZAssertStop(kDebug_BitStream, iBits < (1 << iCountBits)); + ZAssertStop(kDebug_BitStream, iBits < (1U << iCountBits)); uint8* localDest = static_cast<uint8*>(oDest); while (iCountBits--) Modified: trunk/zoolib/source/cxx/zoolib/ZDCFont.cpp =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZDCFont.cpp 2011-11-30 15:00:03 UTC (rev 2627) +++ trunk/zoolib/source/cxx/zoolib/ZDCFont.cpp 2011-11-30 15:00:45 UTC (rev 2628) @@ -75,8 +75,8 @@ ZDCFont::ZDCFont(const ZDCFont& inOther) : fFontName(inOther.fFontName), - fStyle(inOther.fStyle), - fSize(inOther.fSize) + fSize(inOther.fSize), + fStyle(inOther.fStyle) {} ZDCFont::ZDCFont(const string8& inFontName, Style inStyle, int16 inSize) Modified: trunk/zoolib/source/cxx/zoolib/ZDCPixmapCoder_BMP.cpp =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZDCPixmapCoder_BMP.cpp 2011-11-30 15:00:03 UTC (rev 2627) +++ trunk/zoolib/source/cxx/zoolib/ZDCPixmapCoder_BMP.cpp 2011-11-30 15:00:45 UTC (rev 2628) @@ -158,7 +158,7 @@ void* theRowBuffer = &theRowBufferVector[0]; - for (size_t y = iBounds.bottom; y > iBounds.top; --y) + for (int y = iBounds.bottom; y > iBounds.top; --y) { const void* sourceRowAddress = iRasterDesc.CalcRowAddress(iBaseAddress, y - 1); sBlitRow Modified: trunk/zoolib/source/cxx/zoolib/ZDCPixmapNS.cpp =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZDCPixmapNS.cpp 2011-11-30 15:00:03 UTC (rev 2627) +++ trunk/zoolib/source/cxx/zoolib/ZDCPixmapNS.cpp 2011-11-30 15:00:45 UTC (rev 2628) @@ -291,6 +291,7 @@ case eFormatEfficient_Color_16: return eFormatStandard_RGB_16_BE; case eFormatEfficient_Color_24: return eFormatStandard_RGB_24; case eFormatEfficient_Color_32: return eFormatStandard_ARGB_32; + default: break; } return eFormatStandard_Invalid; @@ -1042,7 +1043,8 @@ cumuMask8 |= destMask8; destMask8 = destMask8 >> 1; } - *localDest8++ = (*localDest8 & (0xFF ^ cumuMask8)) | destVal8; + *localDest8 = (*localDest8 & (0xFF ^ cumuMask8)) | destVal8; + ++localDest8; } while (localCount >= 8) @@ -1096,7 +1098,8 @@ destVal8 |= (*iPixvals++ & 0x03) << sourceShift; sourceShift -= 2; } - *localDest8++ = *localDest8 & (0xFF ^ cumuMask8) | destVal8; + *localDest8 = *localDest8 & (0xFF ^ cumuMask8) | destVal8; + ++localDest8; } while (localCount >= 4) @@ -1133,7 +1136,8 @@ if (iStartH & 0x01) { --localCount; - *localDest8++ = (*localDest8 & 0xF0) | (*iPixvals++ & 0x0F); + *localDest8 = (*localDest8 & 0xF0) | (*iPixvals++ & 0x0F); + ++localDest8; } while (localCount >= 2) @@ -1175,7 +1179,8 @@ cumuMask8 |= destMask8; destMask8 = destMask8 << 1; } - *localDest8++ = *localDest8 & (0xFF ^ cumuMask8) | destVal8; + *localDest8 = *localDest8 & (0xFF ^ cumuMask8) | destVal8; + ++localDest8; } while (localCount >= 8) @@ -1229,7 +1234,8 @@ destVal8 |= (*iPixvals++ & 0x03) << sourceShift; sourceShift += 2; } - *localDest8++ = (*localDest8 & (0xFF ^ cumuMask8)) | destVal8; + *localDest8 = (*localDest8 & (0xFF ^ cumuMask8)) | destVal8; + ++localDest8; } while (localCount >= 4) @@ -1266,7 +1272,8 @@ if (iStartH & 0x01) { --localCount; - *localDest8++ = (*localDest8 & 0x0F) | ((*iPixvals++ & 0x0F) << 4); + *localDest8 = (*localDest8 & 0x0F) | ((*iPixvals++ & 0x0F) << 4); + ++localDest8; } while (localCount >= 2) Modified: trunk/zoolib/source/cxx/zoolib/ZIntervalTreeClock.cpp =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZIntervalTreeClock.cpp 2011-11-30 15:00:03 UTC (rev 2627) +++ trunk/zoolib/source/cxx/zoolib/ZIntervalTreeClock.cpp 2011-11-30 15:00:45 UTC (rev 2628) @@ -171,17 +171,17 @@ {} Event::Event(size_t iValue, const ZRef<Event>& iLeft, const ZRef<Event>& iRight) -: fValue(iValue) -, fLeft(iLeft) +: fLeft(iLeft) , fRight(iRight) +, fValue(iValue) { ZAssert(fLeft && fRight || !fLeft && !fRight); } Event::Event(bool iWithZeroChildren, size_t iValue) -: fValue(iValue) -, fLeft(spEventZero) +: fLeft(spEventZero) , fRight(spEventZero) +, fValue(iValue) { ZAssert(iWithZeroChildren); } Modified: trunk/zoolib/source/cxx/zoolib/ZMIME.cpp =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZMIME.cpp 2011-11-30 15:00:03 UTC (rev 2627) +++ trunk/zoolib/source/cxx/zoolib/ZMIME.cpp 2011-11-30 15:00:45 UTC (rev 2628) @@ -172,8 +172,8 @@ ZMIME::StreamR_Line::StreamR_Line(const ZStreamR& iStream) : fStreamR(iStream), - fState(eNormal), - fEmpty(true) + fEmpty(true), + fState(eNormal) {} void ZMIME::StreamR_Line::Imp_Read(void* oDest, size_t iCount, size_t* oCountRead) Modified: trunk/zoolib/source/cxx/zoolib/ZML.cpp =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZML.cpp 2011-11-30 15:00:03 UTC (rev 2627) +++ trunk/zoolib/source/cxx/zoolib/ZML.cpp 2011-11-30 15:00:45 UTC (rev 2628) @@ -296,18 +296,18 @@ StrimU::StrimU(const ZStrimU& iStrim) : fStrim(iStrim), + fRecognizeEntitiesInAttributeValues(false), fBufferStart(0), - fToken(eToken_Fresh), - fRecognizeEntitiesInAttributeValues(false) + fToken(eToken_Fresh) {} StrimU::StrimU(const ZStrimU& iStrim, bool iRecognizeEntitiesInAttributeValues, ZRef<Callable_Entity> iCallable) : fStrim(iStrim), + fRecognizeEntitiesInAttributeValues(iRecognizeEntitiesInAttributeValues), + fCallable(iCallable), fBufferStart(0), - fToken(eToken_Fresh), - fRecognizeEntitiesInAttributeValues(iRecognizeEntitiesInAttributeValues), - fCallable(iCallable) + fToken(eToken_Fresh) {} StrimU::~StrimU() Modified: trunk/zoolib/source/cxx/zoolib/ZNet.cpp =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZNet.cpp 2011-11-30 15:00:03 UTC (rev 2627) +++ trunk/zoolib/source/cxx/zoolib/ZNet.cpp 2011-11-30 15:00:45 UTC (rev 2628) @@ -27,8 +27,8 @@ #pragma mark * ZNetEx ZNetEx::ZNetEx(ZNet::Error iError) -: fError(iError), - runtime_error("ZNetEx") +: runtime_error("ZNetEx"), + fError(iError) {} // ================================================================================================= Modified: trunk/zoolib/source/cxx/zoolib/ZNet_Internet.cpp =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZNet_Internet.cpp 2011-11-30 15:00:03 UTC (rev 2627) +++ trunk/zoolib/source/cxx/zoolib/ZNet_Internet.cpp 2011-11-30 15:00:45 UTC (rev 2628) @@ -99,11 +99,11 @@ const ip6_addr& ZNetAddress_IP6::GetAddr() const { return fAddr; } -const ip6_addr ZNetAddress_IP6::sLoopback = {0}; +const ip6_addr ZNetAddress_IP6::sLoopback = {{{0}}}; const ip6_addr ZNetAddress_IP6::sAny = - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }; + {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}}; // ================================================================================================= #pragma mark - Modified: trunk/zoolib/source/cxx/zoolib/ZNet_Internet_MacOT_OSX.cpp =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZNet_Internet_MacOT_OSX.cpp 2011-11-30 15:00:03 UTC (rev 2627) +++ trunk/zoolib/source/cxx/zoolib/ZNet_Internet_MacOT_OSX.cpp 2011-11-30 15:00:45 UTC (rev 2628) @@ -177,7 +177,7 @@ if (spInitCount++ == 0) { ::InitOpenTransportInContext(kInitOTForExtensionMask, &spOTClientContextPtr); - MPLibraryIsLoaded(); + (void)MPLibraryIsLoaded(); } } Modified: trunk/zoolib/source/cxx/zoolib/ZStream.cpp =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZStream.cpp 2011-11-30 15:00:03 UTC (rev 2627) +++ trunk/zoolib/source/cxx/zoolib/ZStream.cpp 2011-11-30 15:00:45 UTC (rev 2628) @@ -1482,8 +1482,8 @@ #pragma mark * ZStreamWPos_Null ZStreamWPos_Null::ZStreamWPos_Null() -: fSize(0), - fPosition(0) +: fPosition(0), + fSize(0) {} ZStreamWPos_Null::~ZStreamWPos_Null() Modified: trunk/zoolib/source/cxx/zoolib/ZStreamRW_FlushOnRead.cpp =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZStreamRW_FlushOnRead.cpp 2011-11-30 15:00:03 UTC (rev 2627) +++ trunk/zoolib/source/cxx/zoolib/ZStreamRW_FlushOnRead.cpp 2011-11-30 15:00:45 UTC (rev 2628) @@ -46,9 +46,9 @@ */ ZStreamRW_FlushOnRead::ZStreamRW_FlushOnRead(const ZStreamR& iStreamR, const ZStreamW& iStreamW) -: fStreamR(iStreamR), - fStreamW(iStreamW), - fLastWasWrite(0) +: fLastWasWrite(0), + fStreamR(iStreamR), + fStreamW(iStreamW) {} ZStreamRW_FlushOnRead::~ZStreamRW_FlushOnRead() Modified: trunk/zoolib/source/cxx/zoolib/ZStreamW_HexStrim.cpp =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZStreamW_HexStrim.cpp 2011-11-30 15:00:03 UTC (rev 2627) +++ trunk/zoolib/source/cxx/zoolib/ZStreamW_HexStrim.cpp 2011-11-30 15:00:45 UTC (rev 2628) @@ -43,8 +43,8 @@ fChunkSeparator(iChunkSeparator), fChunkSize(iChunkSize), fCurrentChunkLength(0), - fHexDigits(spHexDigits), - fWrittenAny(false) + fWrittenAny(false), + fHexDigits(spHexDigits) {} /** Modified: trunk/zoolib/source/cxx/zoolib/ZStream_CGData.cpp =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZStream_CGData.cpp 2011-11-30 15:00:03 UTC (rev 2627) +++ trunk/zoolib/source/cxx/zoolib/ZStream_CGData.cpp 2011-11-30 15:00:45 UTC (rev 2628) @@ -99,8 +99,8 @@ return countRead; } -static void spSkipBytes_RPos(void* iInfo, size_t iCount) - { static_cast<ZStreamerRPos*>(iInfo)->GetStreamR().Skip(iCount); } +//static void spSkipBytes_RPos(void* iInfo, size_t iCount) +// { static_cast<ZStreamerRPos*>(iInfo)->GetStreamR().Skip(iCount); } static void spRewind_RPos(void* iInfo) { static_cast<ZStreamerRPos*>(iInfo)->GetStreamRPos().SetPosition(0); } Modified: trunk/zoolib/source/cxx/zoolib/ZStream_Data_T.h =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZStream_Data_T.h 2011-11-30 15:00:03 UTC (rev 2627) +++ trunk/zoolib/source/cxx/zoolib/ZStream_Data_T.h 2011-11-30 15:00:45 UTC (rev 2628) @@ -81,9 +81,13 @@ }; template <class T> -ZStreamRPos_Data_T<T> MakeStreamRPos_Data_T(const T& iData) +ZStreamRPos_Data_T<T> sStreamRPos_Data_T(const T& iData) { return ZStreamRPos_Data_T<T>(iData); } +template <class T> +ZStreamRPos_Data_T<T> MakeStreamRPos_Data_T(const T& iData) + { return sStreamRPos_Data_T<T>(iData); } + // ================================================================================================= #pragma mark - #pragma mark * ZStreamRWPos_Data_T @@ -202,9 +206,13 @@ }; template <class T> -ZStreamRWPos_Data_T<T> MakeStreamRWPos_Data_T(T& iData) +ZStreamRWPos_Data_T<T> sStreamRWPos_Data_T(T& iData) { return ZStreamRWPos_Data_T<T>(iData); } +template <class T> +ZStreamRWPos_Data_T<T> MakeStreamRWPos_Data_T(T& iData) + { return sStreamRWPos_Data_T<T>(iData); } + // ================================================================================================= #pragma mark - #pragma mark * Data stream reading functions Modified: trunk/zoolib/source/cxx/zoolib/ZStream_LZW.cpp =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZStream_LZW.cpp 2011-11-30 15:00:03 UTC (rev 2627) +++ trunk/zoolib/source/cxx/zoolib/ZStream_LZW.cpp 2011-11-30 15:00:45 UTC (rev 2628) @@ -78,7 +78,7 @@ while (!fFinished && iCount) { size_t countRead; - if (fCountSinceClear == (1 << fCodeSize_Alphabet) - 2) + if (fCountSinceClear == (1U << fCodeSize_Alphabet) - 2) { fBitWriter.WriteBits(localDest, fCodeSize_Emitted, fCode_Clear, &countRead); fCountSinceClear = 0; Modified: trunk/zoolib/source/cxx/zoolib/ZStream_Memory.cpp =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZStream_Memory.cpp 2011-11-30 15:00:03 UTC (rev 2627) +++ trunk/zoolib/source/cxx/zoolib/ZStream_Memory.cpp 2011-11-30 15:00:45 UTC (rev 2628) @@ -307,9 +307,9 @@ */ ZStreamWPos_Memory::ZStreamWPos_Memory(void* iAddress, size_t iSize) : fAddress(static_cast<char*>(iAddress)), + fPosition(0), fSize(iSize), - fCapacity(iSize), - fPosition(0) + fCapacity(iSize) {} /** @@ -320,9 +320,9 @@ */ ZStreamWPos_Memory::ZStreamWPos_Memory(void* iAddress, size_t iSize, size_t iCapacity) : fAddress(static_cast<char*>(iAddress)), + fPosition(0), fSize(iSize), - fCapacity(iCapacity), - fPosition(0) + fCapacity(iCapacity) {} void ZStreamWPos_Memory::Imp_Write(const void* iSource, size_t iCount, size_t* oCountWritten) Modified: trunk/zoolib/source/cxx/zoolib/ZTxn.cpp =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZTxn.cpp 2011-11-30 15:00:03 UTC (rev 2627) +++ trunk/zoolib/source/cxx/zoolib/ZTxn.cpp 2011-11-30 15:00:45 UTC (rev 2628) @@ -226,4 +226,4 @@ iTxn.pRegisterTarget(this); } -} // namespace ZooLib \ No newline at end of file +} // namespace ZooLib Modified: trunk/zoolib/source/cxx/zoolib/ZUSB_OSX.cpp =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZUSB_OSX.cpp 2011-11-30 15:00:03 UTC (rev 2627) +++ trunk/zoolib/source/cxx/zoolib/ZUSB_OSX.cpp 2011-11-30 15:00:45 UTC (rev 2628) @@ -568,8 +568,8 @@ : fUSBII(iUSBII), fII(iIOUSBInterfaceInterface), fPipeRefR(iPipeRefR), + fBuffer(new uint8[iBufferSize]), fSize(iBufferSize), - fBuffer(new uint8[iBufferSize]), fOffset(0), fEnd(0), fPending(false), Modified: trunk/zoolib/source/cxx/zoolib/ZVal_AppleEvent.cpp =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZVal_AppleEvent.cpp 2011-11-30 15:00:03 UTC (rev 2627) +++ trunk/zoolib/source/cxx/zoolib/ZVal_AppleEvent.cpp 2011-11-30 15:00:45 UTC (rev 2628) @@ -135,7 +135,7 @@ long count; if (noErr == ::AECountItems(&iDesc, &count)) { - for (size_t x = 0; x < count; ++x) + for (long x = 0; x < count; ++x) { ZVal_AppleEvent result; if (noErr == ::AEGetNthDesc(&iDesc, x + 1, typeWildCard, nullptr, &result.OParam())) @@ -155,7 +155,7 @@ long count; if (noErr == ::AECountItems(&iDesc, &count)) { - for (size_t x = 0; x < count; ++x) + for (long x = 0; x < count; ++x) { AEKeyword key; ZVal_AppleEvent result; Modified: trunk/zoolib/source/cxx/zoolib/ZVal_NS.mm =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZVal_NS.mm 2011-11-30 15:00:03 UTC (rev 2627) +++ trunk/zoolib/source/cxx/zoolib/ZVal_NS.mm 2011-11-30 15:00:45 UTC (rev 2628) @@ -74,11 +74,8 @@ { if (NSObject* theVal = inherited::Get()) { -// #if defined(MAC_OS_X_VERSION_MIN_REQUIRED) \ -// && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_2 - if ([theVal isMemberOfClass:[NSNull class]]) - return false; -// #endif + if ([theVal isMemberOfClass:[NSNull class]]) + return false; return true; } return false; Modified: trunk/zoolib/source/cxx/zoolib/ZYad_DividedValues.cpp =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZYad_DividedValues.cpp 2011-11-30 15:00:03 UTC (rev 2627) +++ trunk/zoolib/source/cxx/zoolib/ZYad_DividedValues.cpp 2011-11-30 15:00:45 UTC (rev 2628) @@ -31,11 +31,6 @@ #pragma mark - #pragma mark * Static parsing functions -static void spThrowParseException(const string& iMessage) - { - throw ParseException(iMessage); - } - static bool spReadValues(vector<string8>& oValues, UTF32 iDivider_Value, UTF32 iDivider_Line, const ZStrimR& iStrimR) { Modified: trunk/zoolib/source/cxx/zoolib/ZYad_ML.cpp =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZYad_ML.cpp 2011-11-30 15:00:03 UTC (rev 2627) +++ trunk/zoolib/source/cxx/zoolib/ZYad_ML.cpp 2011-11-30 15:00:45 UTC (rev 2628) @@ -137,6 +137,8 @@ oYadR = new ZYadStrimR_ML(fStrimmerU); break; } + default: + break; } if (!oYadR && !fTagName.empty()) Modified: trunk/zoolib/source/cxx/zoolib/ZYad_XMLPList.cpp =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZYad_XMLPList.cpp 2011-11-30 15:00:03 UTC (rev 2627) +++ trunk/zoolib/source/cxx/zoolib/ZYad_XMLPList.cpp 2011-11-30 15:00:45 UTC (rev 2628) @@ -38,14 +38,6 @@ throw ZYadParseException_XMLPList(iMessage); } -static void spBegin(ZML::StrimU& r, const string& iTagName) - { - sSkipText(r); - - if (!sTryRead_Begin(r, iTagName)) - spThrowParseException("Expected begin tag '" + iTagName + "'"); - } - static void spEnd(ZML::StrimU& r, const string& iTagName) { sSkipText(r); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2011-11-30 15:00:14
|
Revision: 2627 http://zoolib.svn.sourceforge.net/zoolib/?rev=2627&view=rev Author: agreen Date: 2011-11-30 15:00:03 +0000 (Wed, 30 Nov 2011) Log Message: ----------- Back out lexical scope stuff for now. It actually doesn't do what I want, which is more like a dynamic scope to be able to do parameter-passing. Modified Paths: -------------- trunk/zoolib/source/cxx/zoolib/ZYadTree.cpp trunk/zoolib/source/cxx/zoolib/ZYadTree.h Modified: trunk/zoolib/source/cxx/zoolib/ZYadTree.cpp =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZYadTree.cpp 2011-11-30 14:59:08 UTC (rev 2626) +++ trunk/zoolib/source/cxx/zoolib/ZYadTree.cpp 2011-11-30 15:00:03 UTC (rev 2627) @@ -48,15 +48,9 @@ ZRef<Chain> Clone(); ZRef<ZYadR> ReadInc(string& oName); - ZRef<ZYadR> ReadAt - (const ZRef<CountedString>& iProtoName, const ZRef<CountedString>& iLexicalScopeName, - const string& iName); + ZRef<ZYadR> ReadAt(const ZRef<CountedString>& iProto, const string& iName); private: - ZRef<ZYadR> pReadAt - (const ZRef<CountedString>& iProtoName, const ZRef<CountedString>& iLexicalScopeName, - const string& iName, bool iAllowLexicalScope); - ZRef<ZYadR> pReadAt(const string& iName); const ZRef<Chain> fParent; @@ -74,7 +68,7 @@ : public ZYadSeqRPos { public: - YadSeqRPos(const ZRef<CountedString>& iProtoName, const ZRef<CountedString>& iLexicalScopeName, + YadSeqRPos(const ZRef<CountedString>& iProto, const ZRef<Chain>& iChain, const ZRef<ZYadSeqRPos>& iYadSeqRPos); // From ZYadSeqR via ZYadSeqRPos @@ -91,8 +85,7 @@ virtual ZRef<ZYadR> ReadAt(uint64 iPosition); private: - const ZRef<CountedString> fProtoName; - const ZRef<CountedString> fLexicalScopeName; + const ZRef<CountedString> fProto; const ZRef<Chain> fChain; const ZRef<ZYadSeqRPos> fYadSeqRPos; }; @@ -105,11 +98,10 @@ : public ZYadMapRPos { public: - YadMapRPos(const ZRef<CountedString>& iProtoName, const ZRef<CountedString>& iLexicalScopeName, + YadMapRPos(const ZRef<CountedString>& iProto, const ZRef<Chain>& iChain, const string& iPosition); - YadMapRPos(const ZRef<CountedString>& iProtoName, const ZRef<CountedString>& iLexicalScopeName, - const ZRef<ZYadMapRPos>& iYad); + YadMapRPos(const ZRef<CountedString>& iProto, const ZRef<ZYadMapRPos>& iYad); // From ZYadMapR via ZYadMapRPos ZRef<ZYadR> ReadInc(string& oName); @@ -122,8 +114,7 @@ virtual ZRef<ZYadR> ReadAt(const string& iName); private: - const ZRef<CountedString> fProtoName; - const ZRef<CountedString> fLexicalScopeName; + const ZRef<CountedString> fProto; ZRef<Chain> fChain; string fPosition; }; @@ -132,18 +123,14 @@ #pragma mark - #pragma mark * Helpers -static ZRef<ZYadR> spWrap - (const ZRef<CountedString>& iProtoName, const ZRef<CountedString>& iLexicalScopeName, +static ZRef<ZYadR> spWrap(const ZRef<CountedString>& iProto, const ZRef<Chain>& iChain, const ZRef<ZYadR>& iYad) { if (ZRef<ZYadSeqRPos> theYadSeqRPos = iYad.DynamicCast<ZYadSeqRPos>()) - return new YadSeqRPos(iProtoName, iLexicalScopeName, iChain, theYadSeqRPos); + return new YadSeqRPos(iProto, iChain, theYadSeqRPos); if (ZRef<ZYadMapRPos> theYadMapRPos = iYad.DynamicCast<ZYadMapRPos>()) - { - return new YadMapRPos - (iProtoName, iLexicalScopeName, new Chain(iChain, theYadMapRPos), string()); - } + return new YadMapRPos(iProto, new Chain(iChain, theYadMapRPos), string()); return iYad; } @@ -175,24 +162,17 @@ ZRef<ZYadR> Chain::pReadAt(const string& iName) { return fYadMapRPos->ReadAt(iName); } -ZRef<ZYadR> Chain::ReadAt - (const ZRef<CountedString>& iProtoName, const ZRef<CountedString>& iLexicalScopeName, - const string& iName) - { return this->pReadAt(iProtoName, iLexicalScopeName, iName, false); } - -ZRef<ZYadR> Chain::pReadAt - (const ZRef<CountedString>& iProtoName, const ZRef<CountedString>& iLexicalScopeName, - const string& iName, bool iAllowLexicalScope) +ZRef<ZYadR> Chain::ReadAt(const ZRef<CountedString>& iProto, const string& iName) { if (ZRef<ZYadR> theYad = this->pReadAt(iName)) - return spWrap(iProtoName, iLexicalScopeName, this, theYad); + return spWrap(iProto, this, theYad); ZRef<Chain> theChain; if (ZQ<ZRef<Chain> > theByNameQ = ZUtil_STL::sQGet(fCacheByName, iName)) { theChain = *theByNameQ; } - else if (ZRef<ZYadStrimR> theProtoYad = this->pReadAt(iProtoName->Get()).DynamicCast<ZYadStrimR>()) + else if (ZRef<ZYadStrimR> theProtoYad = this->pReadAt(iProto->Get()).DynamicCast<ZYadStrimR>()) { const string theTrailString = theProtoYad->GetStrimR().ReadAll8(); if (ZQ<ZRef<Chain> > theByTrailQ = ZUtil_STL::sQGet(fCacheByTrail, theTrailString)) @@ -246,19 +226,11 @@ } if (theChain) - { - if (ZRef<ZYadR> theYadR = - theChain->pReadAt(iProtoName, iLexicalScopeName, iName, iAllowLexicalScope)) - { return theYadR; } - } + return theChain->ReadAt(iProto, iName); // Yay, lexical scoping, disabled for now. - if (iAllowLexicalScope || (iLexicalScopeName && this->pReadAt(iLexicalScopeName->Get()))) - { - return spWrap - (iProtoName, iLexicalScopeName, - fParent, fParent->pReadAt(iProtoName, iLexicalScopeName, iName, true)); - } + if (false && fParent) + return spWrap(iProto, fParent, fParent->pReadAt(iName)); return null; } @@ -267,23 +239,18 @@ #pragma mark - #pragma mark * YadSeqRPos definition -YadSeqRPos::YadSeqRPos - (const ZRef<CountedString>& iProtoName, const ZRef<CountedString>& iLexicalScopeName, +YadSeqRPos::YadSeqRPos(const ZRef<CountedString>& iProto, const ZRef<Chain>& iChain, const ZRef<ZYadSeqRPos>& iYadSeqRPos) -: fProtoName(iProtoName) -, fLexicalScopeName(iLexicalScopeName) +: fProto(iProto) , fChain(iChain) , fYadSeqRPos(iYadSeqRPos) {} ZRef<ZYadR> YadSeqRPos::ReadInc() - { return spWrap(fProtoName, fLexicalScopeName, fChain, fYadSeqRPos->ReadInc()); } + { return spWrap(fProto, fChain, fYadSeqRPos->ReadInc()); } ZRef<ZYadSeqRClone> YadSeqRPos::Clone() - { - return new YadSeqRPos - (fProtoName, fLexicalScopeName, fChain, fYadSeqRPos->Clone().DynamicCast<ZYadSeqRPos>()); - } + { return new YadSeqRPos(fProto, fChain, fYadSeqRPos->Clone().DynamicCast<ZYadSeqRPos>()); } uint64 YadSeqRPos::GetPosition() { return fYadSeqRPos->GetPosition(); } @@ -295,26 +262,21 @@ { return fYadSeqRPos->GetSize(); } ZRef<ZYadR> YadSeqRPos::ReadAt(uint64 iPosition) - { return spWrap(fProtoName, fLexicalScopeName, fChain, fYadSeqRPos->ReadAt(iPosition)); } + { return spWrap(fProto, fChain, fYadSeqRPos->ReadAt(iPosition)); } // ================================================================================================= #pragma mark - #pragma mark * YadMapRPos definition -YadMapRPos::YadMapRPos - (const ZRef<CountedString>& iProtoName, const ZRef<CountedString>& iLexicalScopeName, +YadMapRPos::YadMapRPos(const ZRef<CountedString>& iProto, const ZRef<Chain>& iChain, const string& iPosition) -: fProtoName(iProtoName) -, fLexicalScopeName(iLexicalScopeName) +: fProto(iProto) , fChain(iChain) , fPosition(iPosition) {} -YadMapRPos::YadMapRPos - (const ZRef<CountedString>& iProtoName, const ZRef<CountedString>& iLexicalScopeName, - const ZRef<ZYadMapRPos>& iYad) -: fProtoName(iProtoName) -, fLexicalScopeName(iLexicalScopeName) +YadMapRPos::YadMapRPos(const ZRef<CountedString>& iProto, const ZRef<ZYadMapRPos>& iYad) +: fProto(iProto) , fChain(new Chain(null, iYad)) {} @@ -327,7 +289,7 @@ return fChain->ReadInc(oName); oName = fPosition; - return fChain->ReadAt(fProtoName, fLexicalScopeName, sGetSet(fPosition, string())); + return fChain->ReadAt(fProto, sGetSet(fPosition, string())); } ZRef<ZYadR> YadMapRPos::ReadAt(const string& iName) @@ -335,11 +297,11 @@ if (fChain->IsShared()) fChain = fChain->Clone(); fPosition.clear(); - return fChain->ReadAt(fProtoName, fLexicalScopeName, iName); + return fChain->ReadAt(fProto, iName); } ZRef<ZYadMapRClone> YadMapRPos::Clone() - { return new YadMapRPos(fProtoName, fLexicalScopeName, fChain->Clone(), fPosition); } + { return new YadMapRPos(fProto, fChain->Clone(), fPosition); } void YadMapRPos::SetPosition(const string& iName) { fPosition = iName; } @@ -350,16 +312,10 @@ #pragma mark - #pragma mark * YadMapRPos definition -ZRef<ZYadMapRPos> sYadTree(const ZRef<ZYadMapRPos>& iYadMapRPos, - const string& iProtoName, - const string& iLexicalScopeName) - { - return new YadTree::YadMapRPos(new YadTree::CountedString(iProtoName), - new YadTree::CountedString(iLexicalScopeName), - iYadMapRPos); - } +ZRef<ZYadMapRPos> sYadTree(const ZRef<ZYadMapRPos>& iYadMapRPos, const string& iProtoName) + { return new YadTree::YadMapRPos(new YadTree::CountedString(iProtoName), iYadMapRPos); } ZRef<ZYadMapRPos> sYadTree(const ZRef<ZYadMapRPos>& iYadMapRPos) - { return sYadTree(iYadMapRPos, "_", "__"); } + { return sYadTree(iYadMapRPos, "_"); } } // namespace ZooLib Modified: trunk/zoolib/source/cxx/zoolib/ZYadTree.h =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZYadTree.h 2011-11-30 14:59:08 UTC (rev 2626) +++ trunk/zoolib/source/cxx/zoolib/ZYadTree.h 2011-11-30 15:00:03 UTC (rev 2627) @@ -26,9 +26,7 @@ namespace ZooLib { -ZRef<ZYadMapRPos> sYadTree(const ZRef<ZYadMapRPos>& iYadMapRPos, - const std::string& iProtoName, - const std::string& iLexicalScopeName); +ZRef<ZYadMapRPos> sYadTree(const ZRef<ZYadMapRPos>& iYadMapRPos, const std::string& iProtoName); ZRef<ZYadMapRPos> sYadTree(const ZRef<ZYadMapRPos>& iYadMapRPos); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2011-11-30 14:59:14
|
Revision: 2626 http://zoolib.svn.sourceforge.net/zoolib/?rev=2626&view=rev Author: agreen Date: 2011-11-30 14:59:08 +0000 (Wed, 30 Nov 2011) Log Message: ----------- Remove these -- there are places where I'm using them, but those should go soon. Removed Paths: ------------- trunk/zoolib/source/cxx/zoolib/ZCommer.cpp trunk/zoolib/source/cxx/zoolib/ZCommer.h Deleted: trunk/zoolib/source/cxx/zoolib/ZCommer.cpp =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZCommer.cpp 2011-11-30 14:57:33 UTC (rev 2625) +++ trunk/zoolib/source/cxx/zoolib/ZCommer.cpp 2011-11-30 14:59:08 UTC (rev 2626) @@ -1,98 +0,0 @@ -/* ------------------------------------------------------------------------------------------------- -Copyright (c) 2008 Andrew Green -http://www.zoolib.org - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software -and associated documentation files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, -sublicense, and/or sell copies of the Software, and to permit persons to whom the Software -is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING -BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES -OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF -OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------------------------- */ - -#include "zoolib/ZCaller_Thread.h" -#include "zoolib/ZCommer.h" -#include "zoolib/ZGetSet.h" - -#include "zoolib/ZLog.h" - -namespace ZooLib { - -// ================================================================================================= -#pragma mark - -#pragma mark * ZCommer - -ZCommer::ZCommer(ZRef<ZStreamerR> iStreamerR, ZRef<ZStreamerW> iStreamerW) -: ZStreamerReader(iStreamerR), - ZStreamerWriter(iStreamerW), - fReadStarted(false), - fWriteStarted(false) - {} - -ZCommer::~ZCommer() - { ZAssert(!fReadStarted && !fWriteStarted); } - -void ZCommer::ReadStarted() - { - ZStreamerReader::ReadStarted(); - - ZGuardRMtx guard(fMtx); - ZAssert(!fReadStarted); - fReadStarted = true; - fCnd.Broadcast(); - if (fReadStarted && fWriteStarted) - { - guard.Release(); - this->Started(); - } - } - -bool ZStreamerReader::Read(const ZStreamR& iStreamR) - { return false; } - -bool ZStreamerReader::Write(const ZStreamW& iStreamW) - { return false; } - -void ZCommer::Started() - { - ZGuardRMtx guard(fMtx); - if (ZRef<Callable_t> theCallable = fCallable_Started) - { - guard.Release(); - theCallable->Call(this); - } - } - -void ZCommer::WaitTillFinished() - { - ZAcqMtx locker(fMtx); - while (fReadStarted || fWriteStarted) - fCnd.Wait(fMtx); - } - -void ZCommer::SetCallable_Finished(ZRef<Callable_t> iCallable) - { - ZAcqMtx locker(fMtx); - return sGetSet(fCallable_Finished, iCallable); - } - -// ================================================================================================= -#pragma mark - -#pragma mark * ZCommer utility methods - -void sStartCommerRunners(ZRef<ZCommer> iCommer) - { - ZRef<ZCaller> theCaller = new ZCaller_Thread; - iCommer.StaticCast<ZStreamerReader>()->Attach(theCaller); - iCommer.StaticCast<ZStreamerWriter>()->Attach(theCaller); - } - -} // namespace ZooLib Deleted: trunk/zoolib/source/cxx/zoolib/ZCommer.h =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZCommer.h 2011-11-30 14:57:33 UTC (rev 2625) +++ trunk/zoolib/source/cxx/zoolib/ZCommer.h 2011-11-30 14:59:08 UTC (rev 2626) @@ -1,72 +0,0 @@ -/* ------------------------------------------------------------------------------------------------- -Copyright (c) 2008 Andrew Green -http://www.zoolib.org - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software -and associated documentation files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, -sublicense, and/or sell copies of the Software, and to permit persons to whom the Software -is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING -BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES -OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF -OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------------------------- */ - -#ifndef __ZCommer__ -#define __ZCommer__ 1 -#include "zconfig.h" - -#include "zoolib/ZCallable.h" -#include "zoolib/ZStreamer.h" -#include "zoolib/ZThread.h" - -namespace ZooLib { - -// ================================================================================================= -#pragma mark - -#pragma mark * ZCommer - -class ZCommer -: public ZCounted - { -public: - ZCommer(ZRef<ZStreamerR> iStreamerR, ZRef<ZStreamerW> iStreamerW); - virtual ~ZCommer(); - -// Our protocol - virtual bool Read(const ZStreamR& iStreamR); - virtual bool Write(const ZStreamW& iStreamW); - - void WaitTillFinished(); - - void WakeWrite(); - - typedef ZRef<ZCommer> ZRef_ZCommer; - typedef ZCallable<void(ZRef_ZCommer)> Callable_t; - void SetCallable_Finished(ZRef<Callable_t> iCallable); - -private: - ZMtx fMtx; - ZCnd fCnd; - bool fReadStarted; - bool fWriteStarted; - ZRef<Callable_t> fCallable_Finished; - ZRef<ZStreamerR> fStreamerR; - ZRef<ZStreamerW> fStreamerW; - }; - -// ================================================================================================= -#pragma mark - -#pragma mark * ZCommer utility methods - -void sStartCommerRunners(ZRef<ZCommer> iCommer); - -} // namespace ZooLib - -#endif // __ZCommer__ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2011-11-30 14:57:43
|
Revision: 2625 http://zoolib.svn.sourceforge.net/zoolib/?rev=2625&view=rev Author: agreen Date: 2011-11-30 14:57:33 +0000 (Wed, 30 Nov 2011) Log Message: ----------- Add the ability to write the extended JSON notation I've been using. Modified Paths: -------------- trunk/zoolib/source/cxx/zoolib/ZYad_JSON.cpp trunk/zoolib/source/cxx/zoolib/ZYad_JSON.h Modified: trunk/zoolib/source/cxx/zoolib/ZYad_JSON.cpp =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZYad_JSON.cpp 2011-11-26 03:10:49 UTC (rev 2624) +++ trunk/zoolib/source/cxx/zoolib/ZYad_JSON.cpp 2011-11-30 14:57:33 UTC (rev 2625) @@ -20,6 +20,7 @@ #include "zoolib/ZCompat_cmath.h" #include "zoolib/ZSetRestore_T.h" +#include "zoolib/ZStreamW_HexStrim.h" #include "zoolib/ZStrim_Escaped.h" #include "zoolib/ZTime.h" #include "zoolib/ZUnicode.h" @@ -31,6 +32,7 @@ namespace ZooLib { namespace ZYad_JSON { +using std::min; using std::string; /*! \namespace ZooLib::ZYad_JSON @@ -265,6 +267,42 @@ // ================================================================================================= #pragma mark - +#pragma mark * ReadOptions + +ReadOptions sReadOptions_Extended() + { + ReadOptions theRO; + theRO.fAllowUnquotedPropertyNames = true; + theRO.fAllowEquals = true; + theRO.fAllowSemiColons = true; + theRO.fAllowTerminators = true; + theRO.fLooseSeparators = true; + theRO.fAllowBinary = true; + + return theRO; + } + +// ================================================================================================= +#pragma mark - +#pragma mark * WriteOptions + +WriteOptions::WriteOptions() +: ZYadOptions() +, fUseExtendedNotation(false) + {} + +WriteOptions::WriteOptions(const ZYadOptions& iOther) +: ZYadOptions(iOther) +, fUseExtendedNotation(false) + {} + +WriteOptions::WriteOptions(const WriteOptions& iOther) +: ZYadOptions(iOther) +, fUseExtendedNotation(iOther.fUseExtendedNotation) + {} + +// ================================================================================================= +#pragma mark - #pragma mark * ParseException ParseException::ParseException(const string& iWhat) @@ -407,14 +445,14 @@ #pragma mark * Static writing functions static void spWriteIndent(const ZStrimW& iStrimW, - size_t iCount, const ZYadOptions& iOptions) + size_t iCount, const WriteOptions& iOptions) { while (iCount--) iStrimW.Write(iOptions.fIndentString); } static void spWriteLFIndent(const ZStrimW& iStrimW, - size_t iCount, const ZYadOptions& iOptions) + size_t iCount, const WriteOptions& iOptions) { iStrimW.Write(iOptions.fEOLString); spWriteIndent(iStrimW, iCount, iOptions); @@ -446,6 +484,45 @@ s.Write("\""); } +static bool spContainsProblemChars(const string& iString) + { + if (iString.empty()) + { + // An empty string can't be distinguished from no string at all, so + // we treat it as if it has problem chars, so it will be wrapped in quotes. + return true; + } + + for (string::const_iterator i = iString.begin(), end = iString.end();;) + { + UTF32 theCP; + if (not ZUnicode::sReadInc(i, end, theCP)) + break; + if (not ZUnicode::sIsAlphaDigit(theCP) && '_' != theCP) + return true; + } + + return false; + } + +static void spWritePropName(const ZStrimW& s, const string& iString) + { + ZStrimW_Escaped::Options theOptions; + theOptions.fQuoteQuotes = true; + theOptions.fEscapeHighUnicode = false; + + if (spContainsProblemChars(iString)) + { + s << "\""; + ZStrimW_Escaped(theOptions, s) << iString; + s << "\""; + } + else + { + ZStrimW_Escaped(theOptions, s) << iString; + } + } + static void spToStrim_SimpleValue(const ZStrimW& s, const ZAny& iAny) { if (false) @@ -483,12 +560,134 @@ } } +static void spToStrim_Stream(const ZStrimW& s, const ZStreamRPos& iStreamRPos, + size_t iLevel, const WriteOptions& iOptions, bool iMayNeedInitialLF) + { + uint64 theSize = iStreamRPos.GetSize(); + if (theSize == 0) + { + // we've got an empty Raw + s.Write("()"); + } + else + { + if (iOptions.DoIndentation() && theSize > iOptions.fRawChunkSize) + { + if (iMayNeedInitialLF) + spWriteLFIndent(s, iLevel, iOptions); + + uint64 countRemaining = theSize; + if (iOptions.fRawSizeCap) + countRemaining = min(countRemaining, iOptions.fRawSizeCap.Get()); + + s.Writef("( // %lld bytes", theSize); + + if (countRemaining < theSize) + s.Writef(" (truncated at %lld bytes)", iOptions.fRawSizeCap.Get()); + + spWriteLFIndent(s, iLevel, iOptions); + if (iOptions.fRawAsASCII) + { + for (;;) + { + uint64 lastPos = iStreamRPos.GetPosition(); + const size_t countToCopy = + min(iOptions.fRawChunkSize, ZStream::sClampedSize(countRemaining)); + uint64 countCopied; + ZStreamW_HexStrim(iOptions.fRawByteSeparator, string(), 0, s) + .CopyFrom(iStreamRPos, countToCopy, &countCopied, nullptr); + countRemaining -= countCopied; + if (countCopied == 0) + break; + + iStreamRPos.SetPosition(lastPos); + if (size_t extraSpaces = iOptions.fRawChunkSize - countCopied) + { + // We didn't write a complete line of bytes, so pad it out. + while (extraSpaces--) + { + // Two spaces for the two nibbles + s.Write(" "); + // And then the separator sequence + s.Write(iOptions.fRawByteSeparator); + } + } + + s.Write(" // "); + while (countCopied--) + { + char theChar = iStreamRPos.ReadInt8(); + if (theChar < 0x20 || theChar > 0x7E) + s.WriteCP('.'); + else + s.WriteCP(theChar); + } + spWriteLFIndent(s, iLevel, iOptions); + } + } + else + { + string eol = iOptions.fEOLString; + for (size_t x = 0; x < iLevel; ++x) + eol += iOptions.fIndentString; + + ZStreamW_HexStrim(iOptions.fRawByteSeparator, + eol, iOptions.fRawChunkSize, s).CopyAllFrom(iStreamRPos); + + spWriteLFIndent(s, iLevel, iOptions); + } + + s.Write(")"); + } + else + { + s.Write("("); + + ZStreamW_HexStrim(iOptions.fRawByteSeparator, string(), 0, s) + .CopyAllFrom(iStreamRPos); + + if (iOptions.fRawAsASCII) + { + iStreamRPos.SetPosition(0); + s.Write(" /* "); + while (theSize--) + { + char theChar = iStreamRPos.ReadInt8(); + if (theChar < 0x20 || theChar > 0x7E) + s.WriteCP('.'); + else + s.WriteCP(theChar); + } + s.Write(" */"); + } + s.Write(")"); + } + } + } + +static void spToStrim_Stream(const ZStrimW& s, const ZStreamR& iStreamR, + size_t iLevel, const WriteOptions& iOptions, bool iMayNeedInitialLF) + { + if (const ZStreamRPos* theStreamRPos = dynamic_cast<const ZStreamRPos*>(&iStreamR)) + { + spToStrim_Stream(s, *theStreamRPos, iLevel, iOptions, iMayNeedInitialLF); + } + else + { + s.Write("("); + + ZStreamW_HexStrim(iOptions.fRawByteSeparator, string(), 0, s) + .CopyAllFrom(iStreamR); + + s.Write(")"); + } + } // ================================================================================================= #pragma mark - #pragma mark * Visitor_Writer Visitor_Writer::Visitor_Writer - (size_t iIndent, const ZYadOptions& iOptions, const ZStrimW& iStrimW) + (size_t iIndent, const WriteOptions& iOptions, const ZStrimW& iStrimW) : fIndent(iIndent), fOptions(iOptions), fStrimW(iStrimW), @@ -499,18 +698,14 @@ { fStrimW << "null"; if (fOptions.fBreakStrings) - fStrimW << " /*!! Unhandled yad !!*/"; + fStrimW << " /*!! Unhandled yad: " << typeid(*iYadR.Get()).name() <<" !!*/"; } void Visitor_Writer::Visit_YadAtomR(const ZRef<ZYadAtomR>& iYadAtomR) { spToStrim_SimpleValue(fStrimW, iYadAtomR->AsAny()); } void Visitor_Writer::Visit_YadStreamR(const ZRef<ZYadStreamR>& iYadStreamR) - { - fStrimW << "null"; - if (fOptions.fBreakStrings) - fStrimW << " /*!! ZYadStreamR not representable in JSON !!*/"; - } + { spToStrim_Stream(fStrimW, iYadStreamR->GetStreamR(), fIndent, fOptions, fMayNeedInitialLF); } void Visitor_Writer::Visit_YadStrimR(const ZRef<ZYadStrimR>& iYadStrimR) { spWriteString(fStrimW, iYadStrimR->GetStrimR()); } @@ -547,6 +742,12 @@ { break; } + else if (fOptions.fUseExtendedNotation.DGet(false)) + { + spWriteLFIndent(fStrimW, fIndent, fOptions); + cur->Accept(*this); + fStrimW.Write(";"); + } else { if (not isFirst) @@ -569,6 +770,13 @@ { break; } + else if (fOptions.fUseExtendedNotation.DGet(false)) + { + if (not isFirst && fOptions.fBreakStrings) + fStrimW.Write(" "); + cur->Accept(*this); + fStrimW.Write(";"); + } else { if (not isFirst) @@ -609,6 +817,17 @@ { break; } + else if (fOptions.fUseExtendedNotation.DGet(false)) + { + spWriteLFIndent(fStrimW, fIndent, fOptions); + spWritePropName(fStrimW, curName); + fStrimW << " = "; + + ZSetRestore_T<size_t> theSR_Indent(fIndent, fIndent + 1); + ZSetRestore_T<bool> theSR_MayNeedInitialLF(fMayNeedInitialLF, true); + cur->Accept(*this); + fStrimW.Write(";"); + } else { if (not isFirst) @@ -635,6 +854,22 @@ { break; } + else if (fOptions.fUseExtendedNotation.DGet(false)) + { + if (not isFirst && fOptions.fBreakStrings) + fStrimW.Write(" "); + + spWritePropName(fStrimW, curName); + if (fOptions.fBreakStrings) + fStrimW.Write(" = "); + else + fStrimW.Write("="); + + ZSetRestore_T<size_t> theSR_Indent(fIndent, fIndent + 1); + ZSetRestore_T<bool> theSR_MayNeedInitialLF(fMayNeedInitialLF, true); + cur->Accept(*this); + fStrimW.Write(";"); + } else { if (not isFirst) @@ -648,8 +883,6 @@ ZSetRestore_T<size_t> theSR_Indent(fIndent, fIndent + 1); ZSetRestore_T<bool> theSR_MayNeedInitialLF(fMayNeedInitialLF, true); - fIndent = fIndent + 1; - fMayNeedInitialLF = true; cur->Accept(*this); } } @@ -670,9 +903,9 @@ { return spMakeYadR_JSON(iStrimmerU, iReadOptions); } void sToStrim(ZRef<ZYadR> iYadR, const ZStrimW& s) - { sToStrim(0, ZYadOptions(), iYadR, s); } + { sToStrim(0, WriteOptions(), iYadR, s); } -void sToStrim(size_t iInitialIndent, const ZYadOptions& iOptions, +void sToStrim(size_t iInitialIndent, const WriteOptions& iOptions, ZRef<ZYadR> iYadR, const ZStrimW& s) { if (iYadR) Modified: trunk/zoolib/source/cxx/zoolib/ZYad_JSON.h =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZYad_JSON.h 2011-11-26 03:10:49 UTC (rev 2624) +++ trunk/zoolib/source/cxx/zoolib/ZYad_JSON.h 2011-11-30 14:57:33 UTC (rev 2625) @@ -40,10 +40,26 @@ ZQ<bool> fAllowSemiColons; ZQ<bool> fAllowTerminators; ZQ<bool> fLooseSeparators; + ZQ<bool> fAllowBinary; }; +ReadOptions sReadOptions_Extended(); + // ================================================================================================= #pragma mark - +#pragma mark * WriteOptions + +struct WriteOptions : ZYadOptions + { + WriteOptions(); + WriteOptions(const ZYadOptions& iOther); + WriteOptions(const WriteOptions& iOther); + + ZQ<bool> fUseExtendedNotation; + }; + +// ================================================================================================= +#pragma mark - #pragma mark * ParseException class ParseException : public ZYadParseException_Std @@ -116,7 +132,7 @@ { public: Visitor_Writer - (size_t iIndent, const ZYadOptions& iOptions, const ZStrimW& iStrimW); + (size_t iIndent, const WriteOptions& iOptions, const ZStrimW& iStrimW); // From ZVisitor_Yad virtual void Visit_YadR(const ZRef<ZYadR>& iYadR); @@ -128,7 +144,7 @@ private: size_t fIndent; - const ZYadOptions fOptions; + const WriteOptions fOptions; const ZStrimW& fStrimW; bool fMayNeedInitialLF; }; @@ -142,7 +158,7 @@ void sToStrim(ZRef<ZYadR> iYadR, const ZStrimW& s); -void sToStrim(size_t iInitialIndent, const ZYadOptions& iOptions, +void sToStrim(size_t iInitialIndent, const WriteOptions& iOptions, ZRef<ZYadR> iYadR, const ZStrimW& s); } // namespace ZYad_JSON This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2011-11-26 03:10:55
|
Revision: 2624 http://zoolib.svn.sourceforge.net/zoolib/?rev=2624&view=rev Author: agreen Date: 2011-11-26 03:10:49 +0000 (Sat, 26 Nov 2011) Log Message: ----------- Hmm, not sure how we got executable properties on these files. Fixed. Property Changed: ---------------- trunk/zoolib/source/cxx/zoolib/ZAny.h trunk/zoolib/source/cxx/zoolib/ZCompat_NonCopyable.h trunk/zoolib/source/cxx/zoolib/ZCompat_operator_bool.h trunk/zoolib/source/cxx/zoolib/ZDCPixmapBlit.cpp trunk/zoolib/source/cxx/zoolib/ZDCPixmapBlit.h trunk/zoolib/source/cxx/zoolib/ZDCPixmapBlitPriv.h trunk/zoolib/source/cxx/zoolib/ZML.cpp trunk/zoolib/source/cxx/zoolib/ZML.h trunk/zoolib/source/cxx/zoolib/ZNetDNSSD.cpp trunk/zoolib/source/cxx/zoolib/ZNetDNSSD.h trunk/zoolib/source/cxx/zoolib/ZQ.h trunk/zoolib/source/cxx/zoolib/ZStrimR_Boundary.cpp trunk/zoolib/source/cxx/zoolib/ZStrimR_Boundary.h trunk/zoolib/source/cxx/zoolib/ZStrimR_Rewind.cpp trunk/zoolib/source/cxx/zoolib/ZStrimR_Rewind.h trunk/zoolib/source/cxx/zoolib/ZStrimU_Std.cpp trunk/zoolib/source/cxx/zoolib/ZStrimU_Std.h trunk/zoolib/source/cxx/zoolib/ZStrimU_StreamUTF8Buffered.cpp trunk/zoolib/source/cxx/zoolib/ZStrimU_StreamUTF8Buffered.h trunk/zoolib/source/cxx/zoolib/ZStrim_Escaped.cpp trunk/zoolib/source/cxx/zoolib/ZStrim_Escaped.h trunk/zoolib/source/cxx/zoolib/ZTime.cpp trunk/zoolib/source/cxx/zoolib/ZTime.h trunk/zoolib/source/cxx/zoolib/ZUtil_Any.h trunk/zoolib/source/cxx/zoolib/ZUtil_string.h Property changes on: trunk/zoolib/source/cxx/zoolib/ZAny.h ___________________________________________________________________ Deleted: svn:executable - * Property changes on: trunk/zoolib/source/cxx/zoolib/ZCompat_NonCopyable.h ___________________________________________________________________ Deleted: svn:executable - * Property changes on: trunk/zoolib/source/cxx/zoolib/ZCompat_operator_bool.h ___________________________________________________________________ Deleted: svn:executable - * Property changes on: trunk/zoolib/source/cxx/zoolib/ZDCPixmapBlit.cpp ___________________________________________________________________ Deleted: svn:executable - * Property changes on: trunk/zoolib/source/cxx/zoolib/ZDCPixmapBlit.h ___________________________________________________________________ Deleted: svn:executable - * Property changes on: trunk/zoolib/source/cxx/zoolib/ZDCPixmapBlitPriv.h ___________________________________________________________________ Deleted: svn:executable - * Property changes on: trunk/zoolib/source/cxx/zoolib/ZML.cpp ___________________________________________________________________ Deleted: svn:executable - * Property changes on: trunk/zoolib/source/cxx/zoolib/ZML.h ___________________________________________________________________ Deleted: svn:executable - * Property changes on: trunk/zoolib/source/cxx/zoolib/ZNetDNSSD.cpp ___________________________________________________________________ Deleted: svn:executable - * Property changes on: trunk/zoolib/source/cxx/zoolib/ZNetDNSSD.h ___________________________________________________________________ Deleted: svn:executable - * Property changes on: trunk/zoolib/source/cxx/zoolib/ZQ.h ___________________________________________________________________ Deleted: svn:executable - * Property changes on: trunk/zoolib/source/cxx/zoolib/ZStrimR_Boundary.cpp ___________________________________________________________________ Deleted: svn:executable - * Property changes on: trunk/zoolib/source/cxx/zoolib/ZStrimR_Boundary.h ___________________________________________________________________ Deleted: svn:executable - * Property changes on: trunk/zoolib/source/cxx/zoolib/ZStrimR_Rewind.cpp ___________________________________________________________________ Deleted: svn:executable - * Property changes on: trunk/zoolib/source/cxx/zoolib/ZStrimR_Rewind.h ___________________________________________________________________ Deleted: svn:executable - * Property changes on: trunk/zoolib/source/cxx/zoolib/ZStrimU_Std.cpp ___________________________________________________________________ Deleted: svn:executable - * Property changes on: trunk/zoolib/source/cxx/zoolib/ZStrimU_Std.h ___________________________________________________________________ Deleted: svn:executable - * Property changes on: trunk/zoolib/source/cxx/zoolib/ZStrimU_StreamUTF8Buffered.cpp ___________________________________________________________________ Deleted: svn:executable - * Property changes on: trunk/zoolib/source/cxx/zoolib/ZStrimU_StreamUTF8Buffered.h ___________________________________________________________________ Deleted: svn:executable - * Property changes on: trunk/zoolib/source/cxx/zoolib/ZStrim_Escaped.cpp ___________________________________________________________________ Deleted: svn:executable - * Property changes on: trunk/zoolib/source/cxx/zoolib/ZStrim_Escaped.h ___________________________________________________________________ Deleted: svn:executable - * Property changes on: trunk/zoolib/source/cxx/zoolib/ZTime.cpp ___________________________________________________________________ Deleted: svn:executable - * Property changes on: trunk/zoolib/source/cxx/zoolib/ZTime.h ___________________________________________________________________ Deleted: svn:executable - * Property changes on: trunk/zoolib/source/cxx/zoolib/ZUtil_Any.h ___________________________________________________________________ Deleted: svn:executable - * Property changes on: trunk/zoolib/source/cxx/zoolib/ZUtil_string.h ___________________________________________________________________ Deleted: svn:executable - * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2011-11-25 20:47:38
|
Revision: 2623 http://zoolib.svn.sourceforge.net/zoolib/?rev=2623&view=rev Author: agreen Date: 2011-11-25 20:47:32 +0000 (Fri, 25 Nov 2011) Log Message: ----------- Use decimal notation -- apparently the hex notation may not be to spec. Modified Paths: -------------- trunk/zoolib/source/cxx/zoolib/ZML.cpp Modified: trunk/zoolib/source/cxx/zoolib/ZML.cpp =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZML.cpp 2011-11-25 20:46:17 UTC (rev 2622) +++ trunk/zoolib/source/cxx/zoolib/ZML.cpp 2011-11-25 20:47:32 UTC (rev 2623) @@ -962,7 +962,7 @@ case '<': fStrimSink.Write("<"); break; case '>': fStrimSink.Write(">"); break; case 0x00A0: fStrimSink.Write(" "); break; - default: fStrimSink.Writef("&#x%02X;", (unsigned int)*theEntityCPQ); + default: fStrimSink.Writef("&#%u;", (unsigned int)*theEntityCPQ); } localSource = current; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2011-11-25 20:46:23
|
Revision: 2622 http://zoolib.svn.sourceforge.net/zoolib/?rev=2622&view=rev Author: agreen Date: 2011-11-25 20:46:17 +0000 (Fri, 25 Nov 2011) Log Message: ----------- Fix sCog_Not. Modified Paths: -------------- trunk/zoolib/source/cxx/zoolib/ZCog.h Modified: trunk/zoolib/source/cxx/zoolib/ZCog.h =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZCog.h 2011-11-25 20:39:09 UTC (rev 2621) +++ trunk/zoolib/source/cxx/zoolib/ZCog.h 2011-11-25 20:46:17 UTC (rev 2622) @@ -178,17 +178,18 @@ ZCog<Param> spCogFun_Not(const ZCog<Param>& iSelf, Param iParam, const ZCog<Param>& iCog) { - if (iCog && not sIsTerm(iCog)) - { - const ZCog<Param> newCog = iCog->Call(iCog, iParam); - if (not newCog || sIsTerm(newCog)) - return iCog; - } - return iSelf; + if (not iCog || sIsTerm(iCog)) + return iSelf; + + const ZCog<Param> newCog = iCog->Call(iCog, iParam); + if (not newCog || sIsTerm(newCog)) + return iSelf; + + return null; } template <class Param> -const ZCog<Param>& sCog_Not +ZCog<Param> sCog_Not (const ZRef<ZCallable<ZCog<Param>(const ZCog<Param>&,Param)> >& iCallable) { static ZMACRO_auto(spCallable, sCallable(spCogFun_Not<Param>)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2011-11-25 20:39:15
|
Revision: 2621 http://zoolib.svn.sourceforge.net/zoolib/?rev=2621&view=rev Author: agreen Date: 2011-11-25 20:39:09 +0000 (Fri, 25 Nov 2011) Log Message: ----------- <iterator> needed in VC2010. Modified Paths: -------------- trunk/zoolib/source/cxx/old/zoolib/ZVal_ZooLib.cpp Modified: trunk/zoolib/source/cxx/old/zoolib/ZVal_ZooLib.cpp =================================================================== --- trunk/zoolib/source/cxx/old/zoolib/ZVal_ZooLib.cpp 2011-11-25 20:38:38 UTC (rev 2620) +++ trunk/zoolib/source/cxx/old/zoolib/ZVal_ZooLib.cpp 2011-11-25 20:39:09 UTC (rev 2621) @@ -27,6 +27,7 @@ #include "zoolib/ZLog.h" #include <map> +#include <iterator> #include <string.h> #include <typeinfo> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2011-11-25 20:38:44
|
Revision: 2620 http://zoolib.svn.sourceforge.net/zoolib/?rev=2620&view=rev Author: agreen Date: 2011-11-25 20:38:38 +0000 (Fri, 25 Nov 2011) Log Message: ----------- Using an empty tag makes for some messy indentation. Modified Paths: -------------- trunk/zoolib/source/cxx/zoolib/ZYad_XMLPList.cpp Modified: trunk/zoolib/source/cxx/zoolib/ZYad_XMLPList.cpp =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZYad_XMLPList.cpp 2011-11-25 20:37:47 UTC (rev 2619) +++ trunk/zoolib/source/cxx/zoolib/ZYad_XMLPList.cpp 2011-11-25 20:38:38 UTC (rev 2620) @@ -403,9 +403,9 @@ } else { - s.Raw() << "<nil/> <!--!! Unhandled: */"; - s << iVal.Type().name(); - s.Raw() << " !!-->"; + s.Begin("nil"); + s.Raw() << "<!--!! Unhandled: */" << iVal.Type().name() << " !!-->"; + s.End("nil"); } } @@ -437,7 +437,9 @@ } else { - s.Raw() << "<nil/> <!--!! Unhandled Yad !!-->"; + s.Begin("nil"); + s.Raw() << "<!--!! Unhandled Yad !!-->"; + s.End("nil"); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2011-11-25 20:37:53
|
Revision: 2619 http://zoolib.svn.sourceforge.net/zoolib/?rev=2619&view=rev Author: agreen Date: 2011-11-25 20:37:47 +0000 (Fri, 25 Nov 2011) Log Message: ----------- Accomodate VC2010. Modified Paths: -------------- trunk/zoolib/source/cxx/zoolib/zconfigl.h Modified: trunk/zoolib/source/cxx/zoolib/zconfigl.h =================================================================== --- trunk/zoolib/source/cxx/zoolib/zconfigl.h 2011-11-18 20:14:31 UTC (rev 2618) +++ trunk/zoolib/source/cxx/zoolib/zconfigl.h 2011-11-25 20:37:47 UTC (rev 2619) @@ -269,24 +269,26 @@ // Objective C we're switching to use the soon-to-be standardized nullptr. #ifdef __cplusplus - #ifndef __MWERKS__ - const class nullptr_t + #ifdef __MWERKS__ + class nullptr_t { public: template <class T> operator T*() const { return 0; } - template <class C, class T> operator T C::*() const { return 0; } private: void operator&() const; - } nullptr = {}; + }; + #define nullptr nullptr_t() + #elif _MSC_VER >= 1600 + // nullptr is naturally available #else - class nullptr_t + const class nullptr_t { public: template <class T> operator T*() const { return 0; } + template <class C, class T> operator T C::*() const { return 0; } private: void operator&() const; - }; - #define nullptr nullptr_t() + } nullptr = {}; #endif #else #ifndef nullptr This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2011-11-18 20:14:37
|
Revision: 2618 http://zoolib.svn.sourceforge.net/zoolib/?rev=2618&view=rev Author: agreen Date: 2011-11-18 20:14:31 +0000 (Fri, 18 Nov 2011) Log Message: ----------- Fix typo. Modified Paths: -------------- trunk/zoolib/source/cxx/zoolib/ZWinWND.cpp Modified: trunk/zoolib/source/cxx/zoolib/ZWinWND.cpp =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZWinWND.cpp 2011-11-18 20:13:18 UTC (rev 2617) +++ trunk/zoolib/source/cxx/zoolib/ZWinWND.cpp 2011-11-18 20:14:31 UTC (rev 2618) @@ -273,7 +273,7 @@ } HWND sCreateDialog(LPCWSTR lpTemplate, HWND hWndParent, ZRef<Callable_Dialog> iCallable) - { return sCreateDialog(lpTemplate, ::GetThreadLocale(), hWndParent, iCallable) } + { return sCreateDialog(lpTemplate, ::GetThreadLocale(), hWndParent, iCallable); } bool sDoOneMessageForDialog(HWND iHWND) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2011-11-18 20:13:24
|
Revision: 2617 http://zoolib.svn.sourceforge.net/zoolib/?rev=2617&view=rev Author: agreen Date: 2011-11-18 20:13:18 +0000 (Fri, 18 Nov 2011) Log Message: ----------- Add sCog_Applied. Modified Paths: -------------- trunk/zoolib/source/cxx/zoolib/ZCog.h Modified: trunk/zoolib/source/cxx/zoolib/ZCog.h =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZCog.h 2011-11-18 20:12:57 UTC (rev 2616) +++ trunk/zoolib/source/cxx/zoolib/ZCog.h 2011-11-18 20:13:18 UTC (rev 2617) @@ -501,6 +501,111 @@ // ================================================================================================= #pragma mark - +#pragma mark * sCog_Applied + +template <class Param> +ZCog<Param> spCogFun_Applied(const ZCog<Param>& iSelf, Param iParam, + const ZCog<Param>& iCog0, const ZCog<Param>& iCog1); + +template <class Param> +ZCog<Param> spCog_Applied + (const ZRef<ZCallable<ZCog<Param>(const ZCog<Param>&,Param)> >& iCallable0, + const ZRef<ZCallable<ZCog<Param>(const ZCog<Param>&,Param)> >& iCallable1) + { + ZAssert(iCallable0 && iCallable1); + static ZMACRO_auto(spCallable, sCallable(spCogFun_Applied<Param>)); + return sBindR(spCallable, iCallable0, iCallable1); + } + +template <class Param> +ZCog<Param> sCog_Applied + (const ZRef<ZCallable<ZCog<Param>(const ZCog<Param>&,Param)> >& iCallable0, + const ZRef<ZCallable<ZCog<Param>(const ZCog<Param>&,Param)> >& iCallable1) + { + if (iCallable0) + { + if (iCallable1) + return spCog_Applied(iCallable0, iCallable1); + return iCallable0; + } + return null; + } + +template <class Param> +ZCog<Param> spCogFun_Applied(const ZCog<Param>& iSelf, Param iParam, + const ZCog<Param>& iCog0, const ZCog<Param>& iCog1) + { + ZAssert(iCog0 && iCog1); + ZCog<Param> lCog0 = iCog0; + ZCog<Param> lCog1 = iCog1; + + if (sIsTerm(lCog0)) + { + if (not sIsTerm(lCog1) && not lCog1->Call(lCog1, iParam)) + return null; + return lCog0; + } + else if (sCallValidCogUnchanged(lCog0, iParam)) + { + if (sIsTerm(lCog1)) + return lCog0; + if (sCallValidCogUnchanged(lCog1, iParam)) + return iSelf; + if (not lCog1) + return lCog0; + if (sIsTerm(lCog1)) + return lCog0; + return spCog_Both(lCog0, lCog1); + } + else if (not lCog0) + { + return null; + } + else if (sIsTerm(lCog0)) + { + if (sIsTerm(lCog1)) + return lCog1; + if ((lCog1 = lCog1->Call(lCog1, iParam)) && sIsTerm(lCog1)) + return lCog1; + return null; + } + else if (sIsTerm(lCog1)) + { + return lCog0; + } + else if ((lCog1 = lCog1->Call(lCog1, iParam))) + { + if (sIsTerm(lCog1)) + return lCog0; + return spCog_Both(lCog0, lCog1); + } + else + { + return null; + } + } + +template <class Param> +ZCog<Param> operator^ + (const ZRef<ZCallable<ZCog<Param>(const ZCog<Param>&,Param)> >& iCallable0, + const ZRef<ZCallable<ZCog<Param>(const ZCog<Param>&,Param)> >& iCallable1) + { return sCog_Applied<Param>(iCallable0, iCallable1); } + +template <class Param> +ZCog<Param>& operator^= + (ZCog<Param>& ioCog0, + const ZRef<ZCallable<ZCog<Param>(const ZCog<Param>&,Param)> >& iCallable1) + { return ioCog0 = sCog_Applied<Param>(ioCog0, iCallable1); } + +template <class Param> +struct ZCogAccumulatorCombiner_Applied + { + void operator()(ZCog<Param>& io0, const ZCog<Param>& i1) const + { io0 = sCog_Applied(io0, i1); } + }; + +// ================================================================================================= +#pragma mark - #pragma mark * sCog_FollowedBy template <class Param> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2011-11-18 20:13:03
|
Revision: 2616 http://zoolib.svn.sourceforge.net/zoolib/?rev=2616&view=rev Author: agreen Date: 2011-11-18 20:12:57 +0000 (Fri, 18 Nov 2011) Log Message: ----------- Make LCID an explicit parameter. Modified Paths: -------------- trunk/zoolib/source/cxx/zoolib/ZWinWND.cpp trunk/zoolib/source/cxx/zoolib/ZWinWND.h Modified: trunk/zoolib/source/cxx/zoolib/ZWinWND.cpp =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZWinWND.cpp 2011-11-18 20:12:26 UTC (rev 2615) +++ trunk/zoolib/source/cxx/zoolib/ZWinWND.cpp 2011-11-18 20:12:57 UTC (rev 2616) @@ -249,13 +249,11 @@ #pragma mark - #pragma mark * ZWinWND, Callable <--> Dialog -HWND sCreateDialog(LPCWSTR lpTemplate, HWND hWndParent, ZRef<Callable_Dialog> iCallable) +HWND sCreateDialog(LPCWSTR lpTemplate, LCID iLCID, HWND hWndParent, ZRef<Callable_Dialog> iCallable) { HMODULE theHMODULE = ZUtil_Win::sGetModuleHandle(); - LCID theLCID = ::GetThreadLocale(); - - if (HRSRC theHRSRC = ::FindResourceExW(theHMODULE, (LPCWSTR)RT_DIALOG, lpTemplate, theLCID)) + if (HRSRC theHRSRC = ::FindResourceExW(theHMODULE, (LPCWSTR)RT_DIALOG, lpTemplate, iLCID)) { HGLOBAL theHGLOBAL = ::LoadResource(theHMODULE, theHRSRC); return ::CreateDialogIndirectParam @@ -274,6 +272,9 @@ (LPARAM)iCallable.Get()); } +HWND sCreateDialog(LPCWSTR lpTemplate, HWND hWndParent, ZRef<Callable_Dialog> iCallable) + { return sCreateDialog(lpTemplate, ::GetThreadLocale(), hWndParent, iCallable) } + bool sDoOneMessageForDialog(HWND iHWND) { MSG theMSG; Modified: trunk/zoolib/source/cxx/zoolib/ZWinWND.h =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZWinWND.h 2011-11-18 20:12:26 UTC (rev 2615) +++ trunk/zoolib/source/cxx/zoolib/ZWinWND.h 2011-11-18 20:12:57 UTC (rev 2616) @@ -78,6 +78,7 @@ typedef ZCallable<INT_PTR(HWND,UINT,WPARAM,LPARAM)> Callable_Dialog; +HWND sCreateDialog(LPCWSTR lpTemplate, LCID iLCID, HWND hWndParent, ZRef<Callable_Dialog> iCallable); HWND sCreateDialog(LPCWSTR lpTemplate, HWND hWndParent, ZRef<Callable_Dialog> iCallable); bool sDoOneMessageForDialog(HWND iHWND); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2011-11-18 20:12:33
|
Revision: 2615 http://zoolib.svn.sourceforge.net/zoolib/?rev=2615&view=rev Author: agreen Date: 2011-11-18 20:12:26 +0000 (Fri, 18 Nov 2011) Log Message: ----------- Some steps to allow for lexical scoping. Modified Paths: -------------- trunk/zoolib/source/cxx/zoolib/ZYadTree.cpp trunk/zoolib/source/cxx/zoolib/ZYadTree.h Modified: trunk/zoolib/source/cxx/zoolib/ZYadTree.cpp =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZYadTree.cpp 2011-11-18 18:39:50 UTC (rev 2614) +++ trunk/zoolib/source/cxx/zoolib/ZYadTree.cpp 2011-11-18 20:12:26 UTC (rev 2615) @@ -48,9 +48,15 @@ ZRef<Chain> Clone(); ZRef<ZYadR> ReadInc(string& oName); - ZRef<ZYadR> ReadAt(const ZRef<CountedString>& iProto, const string& iName); + ZRef<ZYadR> ReadAt + (const ZRef<CountedString>& iProtoName, const ZRef<CountedString>& iLexicalScopeName, + const string& iName); private: + ZRef<ZYadR> pReadAt + (const ZRef<CountedString>& iProtoName, const ZRef<CountedString>& iLexicalScopeName, + const string& iName, bool iAllowLexicalScope); + ZRef<ZYadR> pReadAt(const string& iName); const ZRef<Chain> fParent; @@ -68,7 +74,7 @@ : public ZYadSeqRPos { public: - YadSeqRPos(const ZRef<CountedString>& iProto, + YadSeqRPos(const ZRef<CountedString>& iProtoName, const ZRef<CountedString>& iLexicalScopeName, const ZRef<Chain>& iChain, const ZRef<ZYadSeqRPos>& iYadSeqRPos); // From ZYadSeqR via ZYadSeqRPos @@ -85,7 +91,8 @@ virtual ZRef<ZYadR> ReadAt(uint64 iPosition); private: - const ZRef<CountedString> fProto; + const ZRef<CountedString> fProtoName; + const ZRef<CountedString> fLexicalScopeName; const ZRef<Chain> fChain; const ZRef<ZYadSeqRPos> fYadSeqRPos; }; @@ -98,10 +105,11 @@ : public ZYadMapRPos { public: - YadMapRPos(const ZRef<CountedString>& iProto, + YadMapRPos(const ZRef<CountedString>& iProtoName, const ZRef<CountedString>& iLexicalScopeName, const ZRef<Chain>& iChain, const string& iPosition); - YadMapRPos(const ZRef<CountedString>& iProto, const ZRef<ZYadMapRPos>& iYad); + YadMapRPos(const ZRef<CountedString>& iProtoName, const ZRef<CountedString>& iLexicalScopeName, + const ZRef<ZYadMapRPos>& iYad); // From ZYadMapR via ZYadMapRPos ZRef<ZYadR> ReadInc(string& oName); @@ -114,7 +122,8 @@ virtual ZRef<ZYadR> ReadAt(const string& iName); private: - const ZRef<CountedString> fProto; + const ZRef<CountedString> fProtoName; + const ZRef<CountedString> fLexicalScopeName; ZRef<Chain> fChain; string fPosition; }; @@ -123,14 +132,18 @@ #pragma mark - #pragma mark * Helpers -static ZRef<ZYadR> spWrap(const ZRef<CountedString>& iProto, +static ZRef<ZYadR> spWrap + (const ZRef<CountedString>& iProtoName, const ZRef<CountedString>& iLexicalScopeName, const ZRef<Chain>& iChain, const ZRef<ZYadR>& iYad) { if (ZRef<ZYadSeqRPos> theYadSeqRPos = iYad.DynamicCast<ZYadSeqRPos>()) - return new YadSeqRPos(iProto, iChain, theYadSeqRPos); + return new YadSeqRPos(iProtoName, iLexicalScopeName, iChain, theYadSeqRPos); if (ZRef<ZYadMapRPos> theYadMapRPos = iYad.DynamicCast<ZYadMapRPos>()) - return new YadMapRPos(iProto, new Chain(iChain, theYadMapRPos), string()); + { + return new YadMapRPos + (iProtoName, iLexicalScopeName, new Chain(iChain, theYadMapRPos), string()); + } return iYad; } @@ -162,17 +175,24 @@ ZRef<ZYadR> Chain::pReadAt(const string& iName) { return fYadMapRPos->ReadAt(iName); } -ZRef<ZYadR> Chain::ReadAt(const ZRef<CountedString>& iProto, const string& iName) +ZRef<ZYadR> Chain::ReadAt + (const ZRef<CountedString>& iProtoName, const ZRef<CountedString>& iLexicalScopeName, + const string& iName) + { return this->pReadAt(iProtoName, iLexicalScopeName, iName, false); } + +ZRef<ZYadR> Chain::pReadAt + (const ZRef<CountedString>& iProtoName, const ZRef<CountedString>& iLexicalScopeName, + const string& iName, bool iAllowLexicalScope) { if (ZRef<ZYadR> theYad = this->pReadAt(iName)) - return spWrap(iProto, this, theYad); + return spWrap(iProtoName, iLexicalScopeName, this, theYad); ZRef<Chain> theChain; if (ZQ<ZRef<Chain> > theByNameQ = ZUtil_STL::sQGet(fCacheByName, iName)) { theChain = *theByNameQ; } - else if (ZRef<ZYadStrimR> theProtoYad = this->pReadAt(iProto->Get()).DynamicCast<ZYadStrimR>()) + else if (ZRef<ZYadStrimR> theProtoYad = this->pReadAt(iProtoName->Get()).DynamicCast<ZYadStrimR>()) { const string theTrailString = theProtoYad->GetStrimR().ReadAll8(); if (ZQ<ZRef<Chain> > theByTrailQ = ZUtil_STL::sQGet(fCacheByTrail, theTrailString)) @@ -226,11 +246,19 @@ } if (theChain) - return theChain->ReadAt(iProto, iName); + { + if (ZRef<ZYadR> theYadR = + theChain->pReadAt(iProtoName, iLexicalScopeName, iName, iAllowLexicalScope)) + { return theYadR; } + } // Yay, lexical scoping, disabled for now. - if (false && fParent) - return spWrap(iProto, fParent, fParent->pReadAt(iName)); + if (iAllowLexicalScope || (iLexicalScopeName && this->pReadAt(iLexicalScopeName->Get()))) + { + return spWrap + (iProtoName, iLexicalScopeName, + fParent, fParent->pReadAt(iProtoName, iLexicalScopeName, iName, true)); + } return null; } @@ -239,18 +267,23 @@ #pragma mark - #pragma mark * YadSeqRPos definition -YadSeqRPos::YadSeqRPos(const ZRef<CountedString>& iProto, +YadSeqRPos::YadSeqRPos + (const ZRef<CountedString>& iProtoName, const ZRef<CountedString>& iLexicalScopeName, const ZRef<Chain>& iChain, const ZRef<ZYadSeqRPos>& iYadSeqRPos) -: fProto(iProto) +: fProtoName(iProtoName) +, fLexicalScopeName(iLexicalScopeName) , fChain(iChain) , fYadSeqRPos(iYadSeqRPos) {} ZRef<ZYadR> YadSeqRPos::ReadInc() - { return spWrap(fProto, fChain, fYadSeqRPos->ReadInc()); } + { return spWrap(fProtoName, fLexicalScopeName, fChain, fYadSeqRPos->ReadInc()); } ZRef<ZYadSeqRClone> YadSeqRPos::Clone() - { return new YadSeqRPos(fProto, fChain, fYadSeqRPos->Clone().DynamicCast<ZYadSeqRPos>()); } + { + return new YadSeqRPos + (fProtoName, fLexicalScopeName, fChain, fYadSeqRPos->Clone().DynamicCast<ZYadSeqRPos>()); + } uint64 YadSeqRPos::GetPosition() { return fYadSeqRPos->GetPosition(); } @@ -262,21 +295,26 @@ { return fYadSeqRPos->GetSize(); } ZRef<ZYadR> YadSeqRPos::ReadAt(uint64 iPosition) - { return spWrap(fProto, fChain, fYadSeqRPos->ReadAt(iPosition)); } + { return spWrap(fProtoName, fLexicalScopeName, fChain, fYadSeqRPos->ReadAt(iPosition)); } // ================================================================================================= #pragma mark - #pragma mark * YadMapRPos definition -YadMapRPos::YadMapRPos(const ZRef<CountedString>& iProto, +YadMapRPos::YadMapRPos + (const ZRef<CountedString>& iProtoName, const ZRef<CountedString>& iLexicalScopeName, const ZRef<Chain>& iChain, const string& iPosition) -: fProto(iProto) +: fProtoName(iProtoName) +, fLexicalScopeName(iLexicalScopeName) , fChain(iChain) , fPosition(iPosition) {} -YadMapRPos::YadMapRPos(const ZRef<CountedString>& iProto, const ZRef<ZYadMapRPos>& iYad) -: fProto(iProto) +YadMapRPos::YadMapRPos + (const ZRef<CountedString>& iProtoName, const ZRef<CountedString>& iLexicalScopeName, + const ZRef<ZYadMapRPos>& iYad) +: fProtoName(iProtoName) +, fLexicalScopeName(iLexicalScopeName) , fChain(new Chain(null, iYad)) {} @@ -289,7 +327,7 @@ return fChain->ReadInc(oName); oName = fPosition; - return fChain->ReadAt(fProto, sGetSet(fPosition, string())); + return fChain->ReadAt(fProtoName, fLexicalScopeName, sGetSet(fPosition, string())); } ZRef<ZYadR> YadMapRPos::ReadAt(const string& iName) @@ -297,11 +335,11 @@ if (fChain->IsShared()) fChain = fChain->Clone(); fPosition.clear(); - return fChain->ReadAt(fProto, iName); + return fChain->ReadAt(fProtoName, fLexicalScopeName, iName); } ZRef<ZYadMapRClone> YadMapRPos::Clone() - { return new YadMapRPos(fProto, fChain->Clone(), fPosition); } + { return new YadMapRPos(fProtoName, fLexicalScopeName, fChain->Clone(), fPosition); } void YadMapRPos::SetPosition(const string& iName) { fPosition = iName; } @@ -312,10 +350,16 @@ #pragma mark - #pragma mark * YadMapRPos definition -ZRef<ZYadMapRPos> sYadTree(const ZRef<ZYadMapRPos>& iYadMapRPos, const string& iProtoName) - { return new YadTree::YadMapRPos(new YadTree::CountedString(iProtoName), iYadMapRPos); } +ZRef<ZYadMapRPos> sYadTree(const ZRef<ZYadMapRPos>& iYadMapRPos, + const string& iProtoName, + const string& iLexicalScopeName) + { + return new YadTree::YadMapRPos(new YadTree::CountedString(iProtoName), + new YadTree::CountedString(iLexicalScopeName), + iYadMapRPos); + } ZRef<ZYadMapRPos> sYadTree(const ZRef<ZYadMapRPos>& iYadMapRPos) - { return sYadTree(iYadMapRPos, "_"); } + { return sYadTree(iYadMapRPos, "_", "__"); } } // namespace ZooLib Modified: trunk/zoolib/source/cxx/zoolib/ZYadTree.h =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZYadTree.h 2011-11-18 18:39:50 UTC (rev 2614) +++ trunk/zoolib/source/cxx/zoolib/ZYadTree.h 2011-11-18 20:12:26 UTC (rev 2615) @@ -26,7 +26,9 @@ namespace ZooLib { -ZRef<ZYadMapRPos> sYadTree(const ZRef<ZYadMapRPos>& iYadMapRPos, const std::string& iProtoName); +ZRef<ZYadMapRPos> sYadTree(const ZRef<ZYadMapRPos>& iYadMapRPos, + const std::string& iProtoName, + const std::string& iLexicalScopeName); ZRef<ZYadMapRPos> sYadTree(const ZRef<ZYadMapRPos>& iYadMapRPos); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2011-11-18 18:39:57
|
Revision: 2614 http://zoolib.svn.sourceforge.net/zoolib/?rev=2614&view=rev Author: agreen Date: 2011-11-18 18:39:50 +0000 (Fri, 18 Nov 2011) Log Message: ----------- Change name. Modified Paths: -------------- trunk/zoolib/source/cxx/zoolib/ZCaller.h Modified: trunk/zoolib/source/cxx/zoolib/ZCaller.h =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZCaller.h 2011-11-18 18:39:31 UTC (rev 2613) +++ trunk/zoolib/source/cxx/zoolib/ZCaller.h 2011-11-18 18:39:50 UTC (rev 2614) @@ -39,9 +39,9 @@ // ================================================================================================= #pragma mark - -#pragma mark * ZCaller_Null +#pragma mark * ZCaller_Trivial -class ZCaller_Null +class ZCaller_Trivial : public ZCaller { public: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2011-11-18 18:39:37
|
Revision: 2613 http://zoolib.svn.sourceforge.net/zoolib/?rev=2613&view=rev Author: agreen Date: 2011-11-18 18:39:31 +0000 (Fri, 18 Nov 2011) Log Message: ----------- Add a shareable caller. Modified Paths: -------------- trunk/zoolib/source/cxx/zoolib/ZCaller_Thread.h Modified: trunk/zoolib/source/cxx/zoolib/ZCaller_Thread.h =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZCaller_Thread.h 2011-11-18 18:38:56 UTC (rev 2612) +++ trunk/zoolib/source/cxx/zoolib/ZCaller_Thread.h 2011-11-18 18:39:31 UTC (rev 2613) @@ -57,6 +57,12 @@ } return false; } + + static ZRef<ZCaller_Thread> sCaller() + { + static ZRef<ZCaller_Thread> spCaller = new ZCaller_Thread; + return spCaller; + } }; } // namespace ZooLib This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ag...@us...> - 2011-11-18 18:39:02
|
Revision: 2612 http://zoolib.svn.sourceforge.net/zoolib/?rev=2612&view=rev Author: agreen Date: 2011-11-18 18:38:56 +0000 (Fri, 18 Nov 2011) Log Message: ----------- As callables are set from construction onwards we don't need as much protection. Modified Paths: -------------- trunk/zoolib/source/cxx/zoolib/ZRoster.cpp trunk/zoolib/source/cxx/zoolib/ZRoster.h Modified: trunk/zoolib/source/cxx/zoolib/ZRoster.cpp =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZRoster.cpp 2011-11-18 18:37:54 UTC (rev 2611) +++ trunk/zoolib/source/cxx/zoolib/ZRoster.cpp 2011-11-18 18:38:56 UTC (rev 2612) @@ -25,6 +25,7 @@ namespace ZooLib { +using std::set; using std::vector; // ================================================================================================= @@ -46,46 +47,37 @@ void ZRoster::Finalize() { ZGuardRMtx guard(fMtx); - vector<ZRef<Entry> > local(fEntries.begin(), fEntries.end()); - ZRef<ZCallable_Void> theCallable = fCallable_Gone; - for (vector<ZRef<Entry> >::const_iterator ii = local.begin(); ii != local.end(); ++ii) + if (not this->FinishFinalize()) + return; + + for (set<Entry*>::const_iterator ii = fEntries.begin(); ii != fEntries.end(); ++ii) (*ii)->fRoster.Clear(); - if (this->FinishFinalize()) - { - guard.Release(); - sCall(theCallable); - delete this; - } - else - { - // Rare/impossible? Someone snagged a strong reference, reinstate entries' weak references. - ZRef<ZRoster> thisRef = this; - for (vector<ZRef<Entry> >::const_iterator ii = local.begin(); ii != local.end(); ++ii) - (*ii)->fRoster = thisRef; - } + ZRef<ZCallable_Void> theCallable = fCallable_Gone; + + guard.Release(); + + delete this; + + sCall(theCallable); } ZRef<ZRoster::Entry> ZRoster::MakeEntry() { return this->MakeEntry(null, null); } -ZRef<ZRoster::Entry> ZRoster::MakeEntry - (const ZRef<ZCallable_Void>& iCallable_Broadcast, const ZRef<ZCallable_Void>& iCallable_Gone) +ZRef<ZRoster::Entry> ZRoster::MakeEntry(const ZRef<ZCallable_Void>& iCallable_Broadcast, + const ZRef<ZCallable_Void>& iCallable_Gone) { - ZRef<ZRoster> thisRef = this; + ZRef<Entry> theEntry = new Entry(this, iCallable_Broadcast, iCallable_Gone); - ZGuardRMtx guard(fMtx); - - ZRef<Entry> theEntry = new Entry(thisRef, iCallable_Broadcast, null); + { + ZAcqMtx acq(fMtx); ZUtil_STL::sInsertMustNotContain(fEntries, theEntry.Get()); fCnd.Broadcast(); + } - if (ZRef<ZCallable_Void> theCallable = fCallable_Change) - { - guard.Release(); - theCallable->Call(); - } + sCall(fCallable_Change); return theEntry; } @@ -97,15 +89,7 @@ guard.Release(); for (vector<ZRef<Entry> >::const_iterator ii = local.begin(); ii != local.end(); ++ii) - { - ZGuardRMtx guardEntry((*ii)->fMtx); - if (ZRef<ZCallable_Void> theCallable = (*ii)->fCallable_Broadcast) - { - guardEntry.Release(); - theCallable->Call(); - guardEntry.Acquire(); - } - } + sCall((*ii)->fCallable_Broadcast); } size_t ZRoster::Count() @@ -139,20 +123,20 @@ void ZRoster::pFinalizeEntry(Entry* iEntry, const ZRef<ZCallable_Void>& iCallable_Gone) { - ZGuardRMtx guard(fMtx); + { + ZAcqMtx acq(fMtx); - if (iEntry->FinishFinalize()) - { - ZUtil_STL::sEraseMustContain(fEntries, iEntry); - delete iEntry; - fCnd.Broadcast(); - ZRef<ZCallable_Void> theCallable_Change = fCallable_Change; - guard.Release(); - - sCall(theCallable_Change); - sCall(iCallable_Gone); - } + if (not iEntry->FinishFinalize()) + return; + + ZUtil_STL::sEraseMustContain(fEntries, iEntry); + delete iEntry; + fCnd.Broadcast(); } + + sCall(fCallable_Change); + sCall(iCallable_Gone); + } // ================================================================================================= #pragma mark - @@ -171,18 +155,15 @@ {} void ZRoster::Entry::Finalize() - { - ZGuardRMtx guard(fMtx); + { ZRef<ZCallable_Void> theCallable = fCallable_Gone; if (ZRef<ZRoster> theRoster = fRoster) { - guard.Release(); theRoster->pFinalizeEntry(this, theCallable); } else if (this->FinishFinalize()) { - guard.Release(); delete this; sCall(theCallable); } Modified: trunk/zoolib/source/cxx/zoolib/ZRoster.h =================================================================== --- trunk/zoolib/source/cxx/zoolib/ZRoster.h 2011-11-18 18:37:54 UTC (rev 2611) +++ trunk/zoolib/source/cxx/zoolib/ZRoster.h 2011-11-18 18:38:56 UTC (rev 2612) @@ -70,8 +70,8 @@ ZMtx fMtx; ZCnd fCnd; std::set<Entry*> fEntries; - ZRef<ZCallable_Void> fCallable_Change; - ZRef<ZCallable_Void> fCallable_Gone; + const ZRef<ZCallable_Void> fCallable_Change; + const ZRef<ZCallable_Void> fCallable_Gone; friend class Entry; }; @@ -99,9 +99,8 @@ private: ZWeakRef<ZRoster> fRoster; - ZMtx fMtx; - ZRef<ZCallable_Void> fCallable_Broadcast; - ZRef<ZCallable_Void> fCallable_Gone; + const ZRef<ZCallable_Void> fCallable_Broadcast; + const ZRef<ZCallable_Void> fCallable_Gone; friend class ZRoster; }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |