[Zorba-coders] [Merge] lp:~zorba-coders/zorba/mz-htlm-module into lp:zorba/html-module
Markos Zaharioudakis has proposed merging lp:~zorba-coders/zorba/mz-htlm-module into lp:zorba/html-module. Commit message: XmlDataManager is not a singleton anymore Requested reviews: Markos Zaharioudakis (markos-za) For more details, see: https://code.launchpad.net/~zorba-coders/zorba/mz-htlm-module/+merge/178573 XmlDataManager is not a singleton anymore -- https://code.launchpad.net/~zorba-coders/zorba/mz-htlm-module/+merge/178573 Your team Zorba Coders is subscribed to branch lp:zorba/html-module. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
[Zorba-coders] [Merge] lp:~zorba-coders/zorba/mz-htlm-module into lp:zorba/html-module
The proposal to merge lp:~zorba-coders/zorba/mz-htlm-module into lp:zorba/html-module has been updated. Status: Needs review = Merged For more details, see: https://code.launchpad.net/~zorba-coders/zorba/mz-htlm-module/+merge/178573 -- https://code.launchpad.net/~zorba-coders/zorba/mz-htlm-module/+merge/178573 Your team Zorba Coders is subscribed to branch lp:zorba/html-module. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/mz-htlm-module into lp:zorba/html-module
Review: Approve -- https://code.launchpad.net/~zorba-coders/zorba/mz-htlm-module/+merge/178573 Your team Zorba Coders is subscribed to branch lp:zorba/html-module. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
[Zorba-coders] [Merge] lp:~zorba-coders/zorba/mz-htlm-module into lp:zorba/html-module
Markos Zaharioudakis has proposed merging lp:~zorba-coders/zorba/mz-htlm-module into lp:zorba/html-module. Commit message: XmlDataManager is not a singleton any more Requested reviews: Markos Zaharioudakis (markos-za) For more details, see: https://code.launchpad.net/~zorba-coders/zorba/mz-htlm-module/+merge/178585 XmlDataManager is not a singleton any more -- https://code.launchpad.net/~zorba-coders/zorba/mz-htlm-module/+merge/178585 Your team Zorba Coders is subscribed to branch lp:zorba/html-module. === modified file 'src/html.xq.src/html.cpp' --- src/html.xq.src/html.cpp 2011-10-06 07:40:17 + +++ src/html.xq.src/html.cpp 2013-08-05 15:23:31 + @@ -25,8 +25,8 @@ namespace zorba { - namespace htmlmodule - { +namespace htmlmodule +{ //* //* @@ -36,72 +36,80 @@ { } + ItemSequence_t ParseFunction::evaluate( - const ExternalFunction::Arguments_t aArgs, - const StaticContext* aSctxCtx, - const DynamicContext* aDynCtx) const - { -std::auto_ptrstd::istringstream iss; -std::istream *is; -String docString; -Item lStringItem, lOptionsItem; - -if (aArgs.size() = 1) -{ - Iterator_t lArg0Iter = aArgs[0]-getIterator(); - lArg0Iter-open(); - lArg0Iter-next(lStringItem); - lArg0Iter-close(); -} - -if ( lStringItem.isStreamable() ) -{ - // - // The iss auto_ptr can NOT be used since it will delete the stream that, - // in this case, is a data member inside another object and not dynamically - // allocated. - // - // We can't replace iss with is since we still need the auto_ptr for - // the case when the result is not streamable. - // - is = lStringItem.getStream(); -} -else -{ - docString = lStringItem.getStringValue(); - iss.reset (new std::istringstream(docString.c_str())); - is = iss.get(); -} - -if (aArgs.size() == 2) -{ - Iterator_t lArg1Iter = aArgs[1]-getIterator(); - lArg1Iter-open(); - lArg1Iter-next(lOptionsItem); - lArg1Iter-close(); -} - -return ItemSequence_t(new SingletonItemSequence( - createHtmlItem( *is , lOptionsItem ))); - } - -//* -//* - -ItemFactory* HtmlModule::theFactory = 0; +const ExternalFunction::Arguments_t aArgs, +const StaticContext* aSctxCtx, +const DynamicContext* aDynCtx) const +{ + std::auto_ptrstd::istringstream iss; + std::istream *is; + String docString; + Item lStringItem, lOptionsItem; + + if (aArgs.size() = 1) + { +Iterator_t lArg0Iter = aArgs[0]-getIterator(); +lArg0Iter-open(); +lArg0Iter-next(lStringItem); +lArg0Iter-close(); + } + + if ( lStringItem.isStreamable() ) + { +// +// The iss auto_ptr can NOT be used since it will delete the stream that, +// in this case, is a data member inside another object and not dynamically +// allocated. +// +// We can't replace iss with is since we still need the auto_ptr for +// the case when the result is not streamable. +// +is = lStringItem.getStream(); + } + else + { +docString = lStringItem.getStringValue(); +iss.reset (new std::istringstream(docString.c_str())); +is = iss.get(); + } + + if (aArgs.size() == 2) + { +Iterator_t lArg1Iter = aArgs[1]-getIterator(); +lArg1Iter-open(); +lArg1Iter-next(lOptionsItem); +lArg1Iter-close(); + } + + return ItemSequence_t( + new SingletonItemSequence(createHtmlItem(*is, lOptionsItem))); +} + + +//* +//* +HtmlModule::HtmlModule() +{ + Zorba* engine = Zorba::getInstance(0); + + theFactory = engine-getItemFactory(); +} + HtmlModule::~HtmlModule() { for ( FuncMap_t::const_iterator lIter = theFunctions.begin(); lIter != theFunctions.end(); ++lIter) - { - delete lIter-second; - } - theFunctions.clear(); + { +delete lIter-second; + } + theFunctions.clear(); } + ExternalFunction* HtmlModule::getExternalFunction(const String aLocalname) { @@ -127,6 +135,8 @@ } delete this; } + + //* //* === modified file 'src/html.xq.src/html.h' --- src/html.xq.src/html.h 2011-10-06 07:40:17 + +++ src/html.xq.src/html.h 2013-08-05 15:23:31 + @@ -26,87 +26,85 @@ { namespace htmlmodule { -//*
Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/mz-htlm-module into lp:zorba/html-module
Review: Approve -- https://code.launchpad.net/~zorba-coders/zorba/mz-htlm-module/+merge/178585 Your team Zorba Coders is subscribed to branch lp:zorba/html-module. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
[Zorba-coders] [Merge] lp:~zorba-coders/zorba/mz-htlm-module into lp:zorba/html-module
Validation queue starting for the following merge proposals: https://code.launchpad.net/~zorba-coders/zorba/mz-htlm-module/+merge/178585 Progress dashboard at http://jenkins.lambda.nu/view/ValidationQueue -- https://code.launchpad.net/~zorba-coders/zorba/mz-htlm-module/+merge/178585 Your team Zorba Coders is subscribed to branch lp:zorba/html-module. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
[Zorba-coders] [Merge] lp:~zorba-coders/zorba/mz-htlm-module into lp:zorba/html-module
The proposal to merge lp:~zorba-coders/zorba/mz-htlm-module into lp:zorba/html-module has been updated. Status: Needs review = Merged For more details, see: https://code.launchpad.net/~zorba-coders/zorba/mz-htlm-module/+merge/178585 -- https://code.launchpad.net/~zorba-coders/zorba/mz-htlm-module/+merge/178585 Your team Zorba Coders is subscribed to branch lp:zorba/html-module. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
[Zorba-coders] [Merge] lp:~zorba-coders/zorba/mz-htlm-module into lp:zorba/html-module
Validation queue succeeded - proposal merged! -- https://code.launchpad.net/~zorba-coders/zorba/mz-htlm-module/+merge/178585 Your team Zorba Coders is subscribed to branch lp:zorba/html-module. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
[Zorba-coders] [Merge] lp:~zorba-coders/zorba/mz-htlm-module into lp:zorba/html-module
Validation queue starting for the following merge proposals: https://code.launchpad.net/~zorba-coders/zorba/mz-htlm-module/+merge/178585 Progress dashboard at http://jenkins.lambda.nu/view/ValidationQueue -- https://code.launchpad.net/~zorba-coders/zorba/mz-htlm-module/+merge/178585 Your team Zorba Coders is subscribed to branch lp:zorba/html-module. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
[Zorba-coders] [Merge] lp:~zorba-coders/zorba/mz-htlm-module into lp:zorba/html-module
Validation queue result for https://code.launchpad.net/~zorba-coders/zorba/mz-htlm-module/+merge/178585 Stage ZorbaVQ failed. Check console output at http://jenkins.lambda.nu/job/ZorbaVQ/213/console to view the results. -- https://code.launchpad.net/~zorba-coders/zorba/mz-htlm-module/+merge/178585 Your team Zorba Coders is subscribed to branch lp:zorba/html-module. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp