2007-12-04 11:12:56 +00:00
|
|
|
/* <!-- copyright */
|
|
|
|
/*
|
|
|
|
* aria2 - The high speed download utility
|
|
|
|
*
|
|
|
|
* Copyright (C) 2006 Tatsuhiro Tsujikawa
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2010-01-05 16:01:46 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
2007-12-04 11:12:56 +00:00
|
|
|
*
|
|
|
|
* In addition, as a special exception, the copyright holders give
|
|
|
|
* permission to link the code of portions of this program with the
|
|
|
|
* OpenSSL library under certain conditions as described in each
|
|
|
|
* individual source file, and distribute linked combinations
|
|
|
|
* including the two.
|
|
|
|
* You must obey the GNU General Public License in all respects
|
|
|
|
* for all of the code used other than OpenSSL. If you modify
|
|
|
|
* file(s) with this exception, you may extend this exception to your
|
|
|
|
* version of the file(s), but you are not obligated to do so. If you
|
|
|
|
* do not wish to do so, delete this exception statement from your
|
|
|
|
* version. If you delete this exception statement from all source
|
|
|
|
* files in the program, then also delete it here.
|
|
|
|
*/
|
|
|
|
/* copyright --> */
|
|
|
|
#include "MetalinkParserStateMachine.h"
|
2009-10-03 12:52:16 +00:00
|
|
|
#include "MetalinkParserStateImpl.h"
|
2010-02-25 14:40:18 +00:00
|
|
|
#include "MetalinkParserStateV3Impl.h"
|
|
|
|
#include "MetalinkParserStateV4Impl.h"
|
2007-12-04 11:12:56 +00:00
|
|
|
#include "Metalinker.h"
|
2008-02-08 15:53:45 +00:00
|
|
|
#include "MetalinkEntry.h"
|
|
|
|
|
|
|
|
namespace aria2 {
|
2007-12-04 11:12:56 +00:00
|
|
|
|
2009-10-03 12:52:16 +00:00
|
|
|
MetalinkParserState* MetalinkParserStateMachine::_initialState =
|
|
|
|
new InitialMetalinkParserState();
|
2010-02-25 14:40:18 +00:00
|
|
|
MetalinkParserState* MetalinkParserStateMachine::_skipTagState =
|
|
|
|
new SkipTagMetalinkParserState();
|
|
|
|
|
2009-10-03 12:52:16 +00:00
|
|
|
MetalinkParserState* MetalinkParserStateMachine::_metalinkState =
|
|
|
|
new MetalinkMetalinkParserState();
|
|
|
|
MetalinkParserState* MetalinkParserStateMachine::_filesState =
|
|
|
|
new FilesMetalinkParserState();
|
|
|
|
MetalinkParserState* MetalinkParserStateMachine::_fileState =
|
|
|
|
new FileMetalinkParserState();
|
|
|
|
MetalinkParserState* MetalinkParserStateMachine::_sizeState =
|
|
|
|
new SizeMetalinkParserState();
|
|
|
|
MetalinkParserState* MetalinkParserStateMachine::_versionState =
|
|
|
|
new VersionMetalinkParserState();
|
|
|
|
MetalinkParserState* MetalinkParserStateMachine::_languageState =
|
|
|
|
new LanguageMetalinkParserState();
|
|
|
|
MetalinkParserState* MetalinkParserStateMachine::_osState =
|
|
|
|
new OSMetalinkParserState();
|
|
|
|
MetalinkParserState* MetalinkParserStateMachine::_verificationState =
|
|
|
|
new VerificationMetalinkParserState();
|
|
|
|
MetalinkParserState* MetalinkParserStateMachine::_hashState =
|
|
|
|
new HashMetalinkParserState();
|
|
|
|
MetalinkParserState* MetalinkParserStateMachine::_piecesState =
|
|
|
|
new PiecesMetalinkParserState();
|
|
|
|
MetalinkParserState* MetalinkParserStateMachine::_pieceHashState =
|
|
|
|
new PieceHashMetalinkParserState();
|
2008-07-12 13:35:35 +00:00
|
|
|
MetalinkParserState* MetalinkParserStateMachine::_signatureState =
|
|
|
|
new SignatureMetalinkParserState();
|
2009-10-03 12:52:16 +00:00
|
|
|
MetalinkParserState* MetalinkParserStateMachine::_resourcesState =
|
|
|
|
new ResourcesMetalinkParserState();
|
|
|
|
MetalinkParserState* MetalinkParserStateMachine::_urlState =
|
|
|
|
new URLMetalinkParserState();
|
2010-02-25 14:40:18 +00:00
|
|
|
|
|
|
|
MetalinkParserState* MetalinkParserStateMachine::_metalinkStateV4 =
|
|
|
|
new MetalinkMetalinkParserStateV4();
|
|
|
|
MetalinkParserState* MetalinkParserStateMachine::_fileStateV4 =
|
|
|
|
new FileMetalinkParserStateV4();
|
|
|
|
MetalinkParserState* MetalinkParserStateMachine::_sizeStateV4 =
|
|
|
|
new SizeMetalinkParserStateV4();
|
|
|
|
MetalinkParserState* MetalinkParserStateMachine::_versionStateV4 =
|
|
|
|
new VersionMetalinkParserStateV4();
|
|
|
|
MetalinkParserState* MetalinkParserStateMachine::_languageStateV4 =
|
|
|
|
new LanguageMetalinkParserStateV4();
|
|
|
|
MetalinkParserState* MetalinkParserStateMachine::_osStateV4 =
|
|
|
|
new OSMetalinkParserStateV4();
|
|
|
|
MetalinkParserState* MetalinkParserStateMachine::_hashStateV4 =
|
|
|
|
new HashMetalinkParserStateV4();
|
|
|
|
MetalinkParserState* MetalinkParserStateMachine::_piecesStateV4 =
|
|
|
|
new PiecesMetalinkParserStateV4();
|
|
|
|
MetalinkParserState* MetalinkParserStateMachine::_pieceHashStateV4 =
|
|
|
|
new PieceHashMetalinkParserStateV4();
|
|
|
|
MetalinkParserState* MetalinkParserStateMachine::_signatureStateV4 =
|
|
|
|
new SignatureMetalinkParserStateV4();
|
|
|
|
MetalinkParserState* MetalinkParserStateMachine::_urlStateV4 =
|
|
|
|
new URLMetalinkParserStateV4();
|
2010-02-25 16:00:24 +00:00
|
|
|
MetalinkParserState* MetalinkParserStateMachine::_metaurlStateV4 =
|
|
|
|
new MetaurlMetalinkParserStateV4();
|
2007-12-04 11:12:56 +00:00
|
|
|
|
|
|
|
MetalinkParserStateMachine::MetalinkParserStateMachine():
|
2009-10-03 12:52:16 +00:00
|
|
|
_ctrl(new MetalinkParserController())
|
2007-12-04 11:12:56 +00:00
|
|
|
{
|
2009-10-03 12:52:16 +00:00
|
|
|
_stateStack.push(_initialState);
|
2007-12-04 11:12:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::setMetalinkState()
|
|
|
|
{
|
2009-10-03 12:52:16 +00:00
|
|
|
_stateStack.push(_metalinkState);
|
2007-12-04 11:12:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::setFilesState()
|
|
|
|
{
|
2009-10-03 12:52:16 +00:00
|
|
|
_stateStack.push(_filesState);
|
2007-12-04 11:12:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::setFileState()
|
|
|
|
{
|
2009-10-03 12:52:16 +00:00
|
|
|
_stateStack.push(_fileState);
|
2007-12-04 11:12:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::setSizeState()
|
|
|
|
{
|
2009-10-03 12:52:16 +00:00
|
|
|
_stateStack.push(_sizeState);
|
2007-12-04 11:12:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::setVersionState()
|
|
|
|
{
|
2009-10-03 12:52:16 +00:00
|
|
|
_stateStack.push(_versionState);
|
2007-12-04 11:12:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::setLanguageState()
|
|
|
|
{
|
2009-10-03 12:52:16 +00:00
|
|
|
_stateStack.push(_languageState);
|
2007-12-04 11:12:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::setOSState()
|
|
|
|
{
|
2009-10-03 12:52:16 +00:00
|
|
|
_stateStack.push(_osState);
|
2007-12-04 11:12:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::setVerificationState()
|
|
|
|
{
|
2009-10-03 12:52:16 +00:00
|
|
|
_stateStack.push(_verificationState);
|
2007-12-04 11:12:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::setHashState()
|
|
|
|
{
|
2009-10-03 12:52:16 +00:00
|
|
|
_stateStack.push(_hashState);
|
2007-12-04 11:12:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::setPiecesState()
|
|
|
|
{
|
2009-10-03 12:52:16 +00:00
|
|
|
_stateStack.push(_piecesState);
|
2007-12-04 11:12:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::setPieceHashState()
|
|
|
|
{
|
2009-10-03 12:52:16 +00:00
|
|
|
_stateStack.push(_pieceHashState);
|
2007-12-04 11:12:56 +00:00
|
|
|
}
|
|
|
|
|
2008-07-12 13:35:35 +00:00
|
|
|
void MetalinkParserStateMachine::setSignatureState()
|
|
|
|
{
|
2009-10-03 12:52:16 +00:00
|
|
|
_stateStack.push(_signatureState);
|
2008-07-12 13:35:35 +00:00
|
|
|
}
|
|
|
|
|
2007-12-04 11:12:56 +00:00
|
|
|
void MetalinkParserStateMachine::setResourcesState()
|
|
|
|
{
|
2009-10-03 12:52:16 +00:00
|
|
|
_stateStack.push(_resourcesState);
|
2007-12-04 11:12:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::setURLState()
|
|
|
|
{
|
2009-10-03 12:52:16 +00:00
|
|
|
_stateStack.push(_urlState);
|
2007-12-04 11:12:56 +00:00
|
|
|
}
|
|
|
|
|
2010-02-25 14:40:18 +00:00
|
|
|
void MetalinkParserStateMachine::setMetalinkStateV4()
|
|
|
|
{
|
|
|
|
_stateStack.push(_metalinkStateV4);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::setFileStateV4()
|
|
|
|
{
|
|
|
|
_stateStack.push(_fileStateV4);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::setSizeStateV4()
|
|
|
|
{
|
|
|
|
_stateStack.push(_sizeStateV4);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::setVersionStateV4()
|
|
|
|
{
|
|
|
|
_stateStack.push(_versionStateV4);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::setLanguageStateV4()
|
|
|
|
{
|
|
|
|
_stateStack.push(_languageStateV4);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::setOSStateV4()
|
|
|
|
{
|
|
|
|
_stateStack.push(_osStateV4);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::setHashStateV4()
|
|
|
|
{
|
|
|
|
_stateStack.push(_hashStateV4);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::setPiecesStateV4()
|
|
|
|
{
|
|
|
|
_stateStack.push(_piecesStateV4);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::setPieceHashStateV4()
|
|
|
|
{
|
|
|
|
_stateStack.push(_pieceHashStateV4);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::setSignatureStateV4()
|
|
|
|
{
|
|
|
|
_stateStack.push(_signatureStateV4);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::setURLStateV4()
|
|
|
|
{
|
|
|
|
_stateStack.push(_urlStateV4);
|
|
|
|
}
|
|
|
|
|
2010-02-25 16:00:24 +00:00
|
|
|
void MetalinkParserStateMachine::setMetaurlStateV4()
|
|
|
|
{
|
|
|
|
_stateStack.push(_metaurlStateV4);
|
|
|
|
}
|
|
|
|
|
2009-10-03 12:52:16 +00:00
|
|
|
void MetalinkParserStateMachine::setSkipTagState()
|
2007-12-04 11:12:56 +00:00
|
|
|
{
|
2009-10-03 12:52:16 +00:00
|
|
|
_stateStack.push(_skipTagState);
|
2007-12-04 11:12:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool MetalinkParserStateMachine::finished() const
|
|
|
|
{
|
2009-10-03 12:52:16 +00:00
|
|
|
return _stateStack.top() == _initialState;
|
2007-12-04 11:12:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::newEntryTransaction()
|
|
|
|
{
|
|
|
|
_ctrl->newEntryTransaction();
|
|
|
|
}
|
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
void MetalinkParserStateMachine::setFileNameOfEntry(const std::string& filename)
|
2007-12-04 11:12:56 +00:00
|
|
|
{
|
|
|
|
_ctrl->setFileNameOfEntry(filename);
|
|
|
|
}
|
|
|
|
|
2008-03-09 12:24:01 +00:00
|
|
|
void MetalinkParserStateMachine::setFileLengthOfEntry(uint64_t length)
|
2007-12-04 11:12:56 +00:00
|
|
|
{
|
|
|
|
_ctrl->setFileLengthOfEntry(length);
|
|
|
|
}
|
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
void MetalinkParserStateMachine::setVersionOfEntry(const std::string& version)
|
2007-12-04 11:12:56 +00:00
|
|
|
{
|
|
|
|
_ctrl->setVersionOfEntry(version);
|
|
|
|
}
|
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
void MetalinkParserStateMachine::setLanguageOfEntry(const std::string& language)
|
2007-12-04 11:12:56 +00:00
|
|
|
{
|
|
|
|
_ctrl->setLanguageOfEntry(language);
|
|
|
|
}
|
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
void MetalinkParserStateMachine::setOSOfEntry(const std::string& os)
|
2007-12-04 11:12:56 +00:00
|
|
|
{
|
|
|
|
_ctrl->setOSOfEntry(os);
|
|
|
|
}
|
|
|
|
|
2008-03-09 12:24:01 +00:00
|
|
|
void MetalinkParserStateMachine::setMaxConnectionsOfEntry(int maxConnections)
|
2007-12-04 11:12:56 +00:00
|
|
|
{
|
|
|
|
_ctrl->setMaxConnectionsOfEntry(maxConnections);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::commitEntryTransaction()
|
|
|
|
{
|
|
|
|
_ctrl->commitEntryTransaction();
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::newResourceTransaction()
|
|
|
|
{
|
|
|
|
_ctrl->newResourceTransaction();
|
|
|
|
}
|
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
void MetalinkParserStateMachine::setURLOfResource(const std::string& url)
|
2007-12-04 11:12:56 +00:00
|
|
|
{
|
|
|
|
_ctrl->setURLOfResource(url);
|
|
|
|
}
|
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
void MetalinkParserStateMachine::setTypeOfResource(const std::string& type)
|
2007-12-04 11:12:56 +00:00
|
|
|
{
|
|
|
|
_ctrl->setTypeOfResource(type);
|
|
|
|
}
|
|
|
|
|
2009-10-03 12:52:16 +00:00
|
|
|
void MetalinkParserStateMachine::setLocationOfResource
|
|
|
|
(const std::string& location)
|
2007-12-04 11:12:56 +00:00
|
|
|
{
|
|
|
|
_ctrl->setLocationOfResource(location);
|
|
|
|
}
|
|
|
|
|
2010-02-25 14:40:18 +00:00
|
|
|
void MetalinkParserStateMachine::setPriorityOfResource(int priority)
|
2007-12-04 11:12:56 +00:00
|
|
|
{
|
2010-02-25 14:40:18 +00:00
|
|
|
_ctrl->setPriorityOfResource(priority);
|
2007-12-04 11:12:56 +00:00
|
|
|
}
|
|
|
|
|
2008-03-09 12:24:01 +00:00
|
|
|
void MetalinkParserStateMachine::setMaxConnectionsOfResource(int maxConnections)
|
2007-12-04 11:12:56 +00:00
|
|
|
{
|
|
|
|
_ctrl->setMaxConnectionsOfResource(maxConnections);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::commitResourceTransaction()
|
|
|
|
{
|
|
|
|
_ctrl->commitResourceTransaction();
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::cancelResourceTransaction()
|
|
|
|
{
|
|
|
|
_ctrl->cancelResourceTransaction();
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::newChecksumTransaction()
|
|
|
|
{
|
|
|
|
_ctrl->newChecksumTransaction();
|
|
|
|
}
|
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
void MetalinkParserStateMachine::setTypeOfChecksum(const std::string& type)
|
2007-12-04 11:12:56 +00:00
|
|
|
{
|
|
|
|
_ctrl->setTypeOfChecksum(type);
|
|
|
|
}
|
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
void MetalinkParserStateMachine::setHashOfChecksum(const std::string& md)
|
2007-12-04 11:12:56 +00:00
|
|
|
{
|
|
|
|
_ctrl->setHashOfChecksum(md);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::commitChecksumTransaction()
|
|
|
|
{
|
|
|
|
_ctrl->commitChecksumTransaction();
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::cancelChecksumTransaction()
|
|
|
|
{
|
|
|
|
_ctrl->cancelChecksumTransaction();
|
|
|
|
}
|
|
|
|
|
2010-02-25 14:40:18 +00:00
|
|
|
void MetalinkParserStateMachine::newChunkChecksumTransactionV4()
|
|
|
|
{
|
|
|
|
_ctrl->newChunkChecksumTransactionV4();
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::setLengthOfChunkChecksumV4(size_t length)
|
|
|
|
{
|
|
|
|
_ctrl->setLengthOfChunkChecksumV4(length);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::setTypeOfChunkChecksumV4
|
|
|
|
(const std::string& type)
|
|
|
|
{
|
|
|
|
_ctrl->setTypeOfChunkChecksumV4(type);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::addHashOfChunkChecksumV4(const std::string& md)
|
|
|
|
{
|
|
|
|
_ctrl->addHashOfChunkChecksumV4(md);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::commitChunkChecksumTransactionV4()
|
|
|
|
{
|
|
|
|
_ctrl->commitChunkChecksumTransactionV4();
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::cancelChunkChecksumTransactionV4()
|
|
|
|
{
|
|
|
|
_ctrl->cancelChunkChecksumTransactionV4();
|
|
|
|
}
|
|
|
|
|
2007-12-04 11:12:56 +00:00
|
|
|
void MetalinkParserStateMachine::newChunkChecksumTransaction()
|
|
|
|
{
|
|
|
|
_ctrl->newChunkChecksumTransaction();
|
|
|
|
}
|
|
|
|
|
2008-03-09 12:24:01 +00:00
|
|
|
void MetalinkParserStateMachine::setLengthOfChunkChecksum(size_t length)
|
2007-12-04 11:12:56 +00:00
|
|
|
{
|
|
|
|
_ctrl->setLengthOfChunkChecksum(length);
|
|
|
|
}
|
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
void MetalinkParserStateMachine::setTypeOfChunkChecksum(const std::string& type)
|
2007-12-04 11:12:56 +00:00
|
|
|
{
|
|
|
|
_ctrl->setTypeOfChunkChecksum(type);
|
|
|
|
}
|
|
|
|
|
2008-03-09 12:24:01 +00:00
|
|
|
void MetalinkParserStateMachine::createNewHashOfChunkChecksum(size_t order)
|
2007-12-04 11:12:56 +00:00
|
|
|
{
|
|
|
|
_ctrl->createNewHashOfChunkChecksum(order);
|
|
|
|
}
|
|
|
|
|
2009-10-03 12:52:16 +00:00
|
|
|
void MetalinkParserStateMachine::setMessageDigestOfChunkChecksum
|
|
|
|
(const std::string& md)
|
2007-12-04 11:12:56 +00:00
|
|
|
{
|
|
|
|
_ctrl->setMessageDigestOfChunkChecksum(md);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::addHashOfChunkChecksum()
|
|
|
|
{
|
|
|
|
_ctrl->addHashOfChunkChecksum();
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::commitChunkChecksumTransaction()
|
|
|
|
{
|
|
|
|
_ctrl->commitChunkChecksumTransaction();
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::cancelChunkChecksumTransaction()
|
|
|
|
{
|
|
|
|
_ctrl->cancelChunkChecksumTransaction();
|
|
|
|
}
|
|
|
|
|
2008-07-12 13:35:35 +00:00
|
|
|
void MetalinkParserStateMachine::newSignatureTransaction()
|
|
|
|
{
|
|
|
|
_ctrl->newSignatureTransaction();
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::setTypeOfSignature(const std::string& type)
|
|
|
|
{
|
|
|
|
_ctrl->setTypeOfSignature(type);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::setFileOfSignature(const std::string& file)
|
|
|
|
{
|
|
|
|
_ctrl->setFileOfSignature(file);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::setBodyOfSignature(const std::string& body)
|
|
|
|
{
|
|
|
|
_ctrl->setBodyOfSignature(body);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::commitSignatureTransaction()
|
|
|
|
{
|
|
|
|
_ctrl->commitSignatureTransaction();
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::cancelSignatureTransaction()
|
|
|
|
{
|
|
|
|
_ctrl->cancelSignatureTransaction();
|
|
|
|
}
|
|
|
|
|
2010-02-25 16:00:24 +00:00
|
|
|
void MetalinkParserStateMachine::newMetaurlTransaction()
|
|
|
|
{
|
|
|
|
_ctrl->newMetaurlTransaction();
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::setURLOfMetaurl(const std::string& url)
|
|
|
|
{
|
|
|
|
_ctrl->setURLOfMetaurl(url);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::setMediatypeOfMetaurl
|
|
|
|
(const std::string& mediatype)
|
|
|
|
{
|
|
|
|
_ctrl->setMediatypeOfMetaurl(mediatype);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::setPriorityOfMetaurl(int priority)
|
|
|
|
{
|
|
|
|
_ctrl->setPriorityOfMetaurl(priority);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::commitMetaurlTransaction()
|
|
|
|
{
|
|
|
|
_ctrl->commitMetaurlTransaction();
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetalinkParserStateMachine::cancelMetaurlTransaction()
|
|
|
|
{
|
|
|
|
_ctrl->cancelMetaurlTransaction();
|
|
|
|
}
|
|
|
|
|
2009-10-03 12:52:16 +00:00
|
|
|
void MetalinkParserStateMachine::beginElement
|
2010-02-25 14:40:18 +00:00
|
|
|
(const std::string& localname,
|
|
|
|
const std::string& prefix,
|
|
|
|
const std::string& nsUri,
|
|
|
|
const std::vector<XmlAttr>& attrs)
|
2007-12-04 11:12:56 +00:00
|
|
|
{
|
2010-02-25 14:40:18 +00:00
|
|
|
_stateStack.top()->beginElement(this, localname, prefix, nsUri, attrs);
|
2007-12-04 11:12:56 +00:00
|
|
|
}
|
|
|
|
|
2009-10-03 12:52:16 +00:00
|
|
|
void MetalinkParserStateMachine::endElement
|
2010-02-25 14:40:18 +00:00
|
|
|
(const std::string& localname,
|
|
|
|
const std::string& prefix,
|
|
|
|
const std::string& nsUri,
|
|
|
|
const std::string& characters)
|
2007-12-04 11:12:56 +00:00
|
|
|
{
|
2010-02-25 14:40:18 +00:00
|
|
|
_stateStack.top()->endElement(this, localname, prefix, nsUri, characters);
|
2009-10-03 12:52:16 +00:00
|
|
|
_stateStack.pop();
|
2007-12-04 11:12:56 +00:00
|
|
|
}
|
|
|
|
|
2008-04-26 07:43:01 +00:00
|
|
|
bool MetalinkParserStateMachine::needsCharactersBuffering() const
|
|
|
|
{
|
2009-10-03 12:52:16 +00:00
|
|
|
return _stateStack.top()->needsCharactersBuffering();
|
2008-04-26 07:43:01 +00:00
|
|
|
}
|
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
} // namespace aria2
|