mirror of https://github.com/aria2/aria2
Use move for XML parser
parent
9e52483c04
commit
c4334ec579
|
@ -37,11 +37,9 @@
|
|||
|
||||
namespace aria2 {
|
||||
|
||||
Checksum::Checksum
|
||||
(const std::string& hashType,
|
||||
const std::string& digest)
|
||||
: hashType_(hashType),
|
||||
digest_(digest)
|
||||
Checksum::Checksum(std::string hashType, std::string digest)
|
||||
: hashType_(std::move(hashType)),
|
||||
digest_(std::move(digest))
|
||||
{}
|
||||
|
||||
Checksum::Checksum()
|
||||
|
@ -55,14 +53,14 @@ bool Checksum::isEmpty() const
|
|||
return digest_.empty();
|
||||
}
|
||||
|
||||
void Checksum::setDigest(const std::string& digest)
|
||||
void Checksum::setDigest(std::string digest)
|
||||
{
|
||||
digest_ = digest;
|
||||
digest_ = std::move(digest);
|
||||
}
|
||||
|
||||
void Checksum::setHashType(const std::string& hashType)
|
||||
void Checksum::setHashType(std::string hashType)
|
||||
{
|
||||
hashType_ = hashType;
|
||||
hashType_ = std::move(hashType);
|
||||
}
|
||||
|
||||
void Checksum::swap(Checksum& other)
|
||||
|
|
|
@ -47,19 +47,19 @@ private:
|
|||
std::string digest_;
|
||||
public:
|
||||
// digest_ is raw byte array of hash value, not ascii hexadecimal notation.
|
||||
Checksum(const std::string& hashType, const std::string& digest);
|
||||
Checksum(std::string hashType, std::string digest);
|
||||
Checksum();
|
||||
~Checksum();
|
||||
|
||||
bool isEmpty() const;
|
||||
|
||||
void setDigest(const std::string& md);
|
||||
void setDigest(std::string md);
|
||||
const std::string& getDigest() const
|
||||
{
|
||||
return digest_;
|
||||
}
|
||||
|
||||
void setHashType(const std::string& type);
|
||||
void setHashType(std::string type);
|
||||
const std::string& getHashType() const
|
||||
{
|
||||
return hashType_;
|
||||
|
|
|
@ -40,11 +40,11 @@ namespace aria2 {
|
|||
ChunkChecksum::ChunkChecksum():pieceLength_(0) {}
|
||||
|
||||
ChunkChecksum::ChunkChecksum
|
||||
(const std::string& hashType,
|
||||
const std::vector<std::string>& pieceHashes,
|
||||
(std::string hashType,
|
||||
std::vector<std::string> pieceHashes,
|
||||
int32_t pieceLength)
|
||||
: hashType_(hashType),
|
||||
pieceHashes_(pieceHashes),
|
||||
: hashType_(std::move(hashType)),
|
||||
pieceHashes_(std::move(pieceHashes)),
|
||||
pieceLength_(pieceLength)
|
||||
{}
|
||||
|
||||
|
@ -75,9 +75,9 @@ const std::string& ChunkChecksum::getPieceHash(size_t index) const
|
|||
}
|
||||
}
|
||||
|
||||
void ChunkChecksum::setHashType(const std::string& hashType)
|
||||
void ChunkChecksum::setHashType(std::string hashType)
|
||||
{
|
||||
hashType_ = hashType;
|
||||
hashType_ = std::move(hashType);
|
||||
}
|
||||
|
||||
void ChunkChecksum::setPieceHashes(std::vector<std::string> pieceHashes)
|
||||
|
|
|
@ -51,8 +51,8 @@ public:
|
|||
ChunkChecksum();
|
||||
|
||||
ChunkChecksum
|
||||
(const std::string& hashType,
|
||||
const std::vector<std::string>& pieceHashes,
|
||||
(std::string hashType,
|
||||
std::vector<std::string> pieceHashes,
|
||||
int32_t pieceLength);
|
||||
|
||||
bool validateChunk(const std::string& actualDigest,
|
||||
|
@ -70,7 +70,7 @@ public:
|
|||
return pieceHashes_;
|
||||
}
|
||||
|
||||
void setHashType(const std::string& hashType);
|
||||
void setHashType(std::string hashType);
|
||||
const std::string& getHashType() const
|
||||
{
|
||||
return hashType_;
|
||||
|
|
|
@ -109,10 +109,10 @@ void mlEndElement(void* userData, const char* nsName)
|
|||
SessionData* sd = reinterpret_cast<SessionData*>(userData);
|
||||
std::string characters;
|
||||
if(sd->psm->needsCharactersBuffering()) {
|
||||
characters = sd->charactersStack.front();
|
||||
characters = std::move(sd->charactersStack.front());
|
||||
sd->charactersStack.pop_front();
|
||||
}
|
||||
sd->psm->endElement(localname, prefix, nsUri, characters);
|
||||
sd->psm->endElement(localname, prefix, nsUri, std::move(characters));
|
||||
delete [] nsUri;
|
||||
}
|
||||
} // namespace
|
||||
|
|
|
@ -85,7 +85,7 @@ void MetalinkParserController::newEntryTransaction()
|
|||
#endif // ENABLE_MESSAGE_DIGEST
|
||||
}
|
||||
|
||||
void MetalinkParserController::setFileNameOfEntry(const std::string& filename)
|
||||
void MetalinkParserController::setFileNameOfEntry(std::string filename)
|
||||
{
|
||||
if(!tEntry_) {
|
||||
return;
|
||||
|
@ -109,28 +109,28 @@ void MetalinkParserController::setFileLengthOfEntry(int64_t length)
|
|||
tEntry_->sizeKnown = true;
|
||||
}
|
||||
|
||||
void MetalinkParserController::setVersionOfEntry(const std::string& version)
|
||||
void MetalinkParserController::setVersionOfEntry(std::string version)
|
||||
{
|
||||
if(!tEntry_) {
|
||||
return;
|
||||
}
|
||||
tEntry_->version = version;
|
||||
tEntry_->version = std::move(version);
|
||||
}
|
||||
|
||||
void MetalinkParserController::setLanguageOfEntry(const std::string& language)
|
||||
void MetalinkParserController::setLanguageOfEntry(std::string language)
|
||||
{
|
||||
if(!tEntry_) {
|
||||
return;
|
||||
}
|
||||
tEntry_->languages.push_back(language);
|
||||
tEntry_->languages.push_back(std::move(language));
|
||||
}
|
||||
|
||||
void MetalinkParserController::setOSOfEntry(const std::string& os)
|
||||
void MetalinkParserController::setOSOfEntry(std::string os)
|
||||
{
|
||||
if(!tEntry_) {
|
||||
return;
|
||||
}
|
||||
tEntry_->oses.push_back(os);
|
||||
tEntry_->oses.push_back(std::move(os));
|
||||
}
|
||||
|
||||
void MetalinkParserController::setMaxConnectionsOfEntry(int maxConnections)
|
||||
|
@ -174,7 +174,7 @@ void MetalinkParserController::newResourceTransaction()
|
|||
tResource_ = make_unique<MetalinkResource>();
|
||||
}
|
||||
|
||||
void MetalinkParserController::setURLOfResource(const std::string& url)
|
||||
void MetalinkParserController::setURLOfResource(std::string url)
|
||||
{
|
||||
if(!tResource_) {
|
||||
return;
|
||||
|
@ -182,16 +182,17 @@ void MetalinkParserController::setURLOfResource(const std::string& url)
|
|||
std::string u = uri::joinUri(baseUri_, url);
|
||||
uri_split_result us;
|
||||
if(uri_split(&us, u.c_str()) == 0) {
|
||||
tResource_->url = u;
|
||||
tResource_->url = std::move(u);
|
||||
if(tResource_->type == MetalinkResource::TYPE_UNKNOWN) {
|
||||
setTypeOfResource(uri::getFieldString(us, USR_SCHEME, u.c_str()));
|
||||
setTypeOfResource(uri::getFieldString(us, USR_SCHEME,
|
||||
tResource_->url.c_str()));
|
||||
}
|
||||
} else {
|
||||
tResource_->url = url;
|
||||
tResource_->url = std::move(url);
|
||||
}
|
||||
}
|
||||
|
||||
void MetalinkParserController::setTypeOfResource(const std::string& type)
|
||||
void MetalinkParserController::setTypeOfResource(std::string type)
|
||||
{
|
||||
if(!tResource_) {
|
||||
return;
|
||||
|
@ -210,12 +211,12 @@ void MetalinkParserController::setTypeOfResource(const std::string& type)
|
|||
}
|
||||
}
|
||||
|
||||
void MetalinkParserController::setLocationOfResource(const std::string& location)
|
||||
void MetalinkParserController::setLocationOfResource(std::string location)
|
||||
{
|
||||
if(!tResource_) {
|
||||
return;
|
||||
}
|
||||
tResource_->location = location;
|
||||
tResource_->location = std::move(location);
|
||||
}
|
||||
|
||||
void MetalinkParserController::setPriorityOfResource(int priority)
|
||||
|
@ -270,7 +271,7 @@ void MetalinkParserController::newChecksumTransaction()
|
|||
#endif // ENABLE_MESSAGE_DIGEST
|
||||
}
|
||||
|
||||
void MetalinkParserController::setTypeOfChecksum(const std::string& type)
|
||||
void MetalinkParserController::setTypeOfChecksum(std::string type)
|
||||
{
|
||||
#ifdef ENABLE_MESSAGE_DIGEST
|
||||
if(!tChecksum_) {
|
||||
|
@ -278,14 +279,14 @@ void MetalinkParserController::setTypeOfChecksum(const std::string& type)
|
|||
}
|
||||
std::string calgo = MessageDigest::getCanonicalHashType(type);
|
||||
if(MessageDigest::supports(calgo)) {
|
||||
tChecksum_->setHashType(calgo);
|
||||
tChecksum_->setHashType(std::move(calgo));
|
||||
} else {
|
||||
cancelChecksumTransaction();
|
||||
}
|
||||
#endif // ENABLE_MESSAGE_DIGEST
|
||||
}
|
||||
|
||||
void MetalinkParserController::setHashOfChecksum(const std::string& md)
|
||||
void MetalinkParserController::setHashOfChecksum(std::string md)
|
||||
{
|
||||
#ifdef ENABLE_MESSAGE_DIGEST
|
||||
if(!tChecksum_) {
|
||||
|
@ -332,7 +333,7 @@ void MetalinkParserController::newChunkChecksumTransactionV4()
|
|||
#endif // ENABLE_MESSAGE_DIGEST
|
||||
}
|
||||
|
||||
void MetalinkParserController::setTypeOfChunkChecksumV4(const std::string& type)
|
||||
void MetalinkParserController::setTypeOfChunkChecksumV4(std::string type)
|
||||
{
|
||||
#ifdef ENABLE_MESSAGE_DIGEST
|
||||
if(!tChunkChecksumV4_) {
|
||||
|
@ -340,7 +341,7 @@ void MetalinkParserController::setTypeOfChunkChecksumV4(const std::string& type)
|
|||
}
|
||||
std::string calgo = MessageDigest::getCanonicalHashType(type);
|
||||
if(MessageDigest::supports(calgo)) {
|
||||
tChunkChecksumV4_->setHashType(calgo);
|
||||
tChunkChecksumV4_->setHashType(std::move(calgo));
|
||||
} else {
|
||||
cancelChunkChecksumTransactionV4();
|
||||
}
|
||||
|
@ -361,7 +362,7 @@ void MetalinkParserController::setLengthOfChunkChecksumV4(size_t length)
|
|||
#endif // ENABLE_MESSAGE_DIGEST
|
||||
}
|
||||
|
||||
void MetalinkParserController::addHashOfChunkChecksumV4(const std::string& md)
|
||||
void MetalinkParserController::addHashOfChunkChecksumV4(std::string md)
|
||||
{
|
||||
#ifdef ENABLE_MESSAGE_DIGEST
|
||||
if(!tChunkChecksumV4_) {
|
||||
|
@ -409,7 +410,7 @@ void MetalinkParserController::newChunkChecksumTransaction()
|
|||
#endif // ENABLE_MESSAGE_DIGEST
|
||||
}
|
||||
|
||||
void MetalinkParserController::setTypeOfChunkChecksum(const std::string& type)
|
||||
void MetalinkParserController::setTypeOfChunkChecksum(std::string type)
|
||||
{
|
||||
#ifdef ENABLE_MESSAGE_DIGEST
|
||||
if(!tChunkChecksum_) {
|
||||
|
@ -417,7 +418,7 @@ void MetalinkParserController::setTypeOfChunkChecksum(const std::string& type)
|
|||
}
|
||||
std::string calgo = MessageDigest::getCanonicalHashType(type);
|
||||
if(MessageDigest::supports(calgo)) {
|
||||
tChunkChecksum_->setHashType(calgo);
|
||||
tChunkChecksum_->setHashType(std::move(calgo));
|
||||
} else {
|
||||
cancelChunkChecksumTransaction();
|
||||
}
|
||||
|
@ -438,14 +439,15 @@ void MetalinkParserController::setLengthOfChunkChecksum(size_t length)
|
|||
#endif // ENABLE_MESSAGE_DIGEST
|
||||
}
|
||||
|
||||
void MetalinkParserController::addHashOfChunkChecksum(size_t order, const std::string& md)
|
||||
void MetalinkParserController::addHashOfChunkChecksum(size_t order,
|
||||
std::string md)
|
||||
{
|
||||
#ifdef ENABLE_MESSAGE_DIGEST
|
||||
if(!tChunkChecksum_) {
|
||||
return;
|
||||
}
|
||||
if(MessageDigest::isValidHash(tChunkChecksum_->getHashType(), md)) {
|
||||
tempChunkChecksums_.push_back(std::make_pair(order, md));
|
||||
tempChunkChecksums_.push_back(std::make_pair(order, std::move(md)));
|
||||
} else {
|
||||
cancelChunkChecksumTransaction();
|
||||
}
|
||||
|
@ -462,7 +464,7 @@ void MetalinkParserController::createNewHashOfChunkChecksum(size_t order)
|
|||
#endif // ENABLE_MESSAGE_DIGEST
|
||||
}
|
||||
|
||||
void MetalinkParserController::setMessageDigestOfChunkChecksum(const std::string& md)
|
||||
void MetalinkParserController::setMessageDigestOfChunkChecksum(std::string md)
|
||||
{
|
||||
#ifdef ENABLE_MESSAGE_DIGEST
|
||||
if(!tChunkChecksum_) {
|
||||
|
@ -524,28 +526,28 @@ void MetalinkParserController::newSignatureTransaction()
|
|||
tSignature_ = make_unique<Signature>();
|
||||
}
|
||||
|
||||
void MetalinkParserController::setTypeOfSignature(const std::string& type)
|
||||
void MetalinkParserController::setTypeOfSignature(std::string type)
|
||||
{
|
||||
if(!tSignature_) {
|
||||
return;
|
||||
}
|
||||
tSignature_->setType(type);
|
||||
tSignature_->setType(std::move(type));
|
||||
}
|
||||
|
||||
void MetalinkParserController::setFileOfSignature(const std::string& file)
|
||||
void MetalinkParserController::setFileOfSignature(std::string file)
|
||||
{
|
||||
if(!tSignature_) {
|
||||
return;
|
||||
}
|
||||
tSignature_->setFile(file);
|
||||
tSignature_->setFile(std::move(file));
|
||||
}
|
||||
|
||||
void MetalinkParserController::setBodyOfSignature(const std::string& body)
|
||||
void MetalinkParserController::setBodyOfSignature(std::string body)
|
||||
{
|
||||
if(!tSignature_) {
|
||||
return;
|
||||
}
|
||||
tSignature_->setBody(body);
|
||||
tSignature_->setBody(std::move(body));
|
||||
}
|
||||
|
||||
void MetalinkParserController::commitSignatureTransaction()
|
||||
|
@ -569,33 +571,32 @@ void MetalinkParserController::newMetaurlTransaction()
|
|||
tMetaurl_ = make_unique<MetalinkMetaurl>();
|
||||
}
|
||||
|
||||
void MetalinkParserController::setURLOfMetaurl(const std::string& url)
|
||||
void MetalinkParserController::setURLOfMetaurl(std::string url)
|
||||
{
|
||||
if(!tMetaurl_) {
|
||||
return;
|
||||
}
|
||||
#ifdef ENABLE_BITTORRENT
|
||||
if(magnet::parse(url)) {
|
||||
tMetaurl_->url = url;
|
||||
tMetaurl_->url = std::move(url);
|
||||
} else
|
||||
#endif // ENABLE_BITTORRENT
|
||||
{
|
||||
std::string u = uri::joinUri(baseUri_, url);
|
||||
if(uri_split(nullptr, u.c_str()) == 0) {
|
||||
tMetaurl_->url = u;
|
||||
tMetaurl_->url = std::move(u);
|
||||
} else {
|
||||
tMetaurl_->url = url;
|
||||
tMetaurl_->url = std::move(url);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MetalinkParserController::setMediatypeOfMetaurl
|
||||
(const std::string& mediatype)
|
||||
void MetalinkParserController::setMediatypeOfMetaurl(std::string mediatype)
|
||||
{
|
||||
if(!tMetaurl_) {
|
||||
return;
|
||||
}
|
||||
tMetaurl_->mediatype = mediatype;
|
||||
tMetaurl_->mediatype = std::move(mediatype);
|
||||
}
|
||||
|
||||
void MetalinkParserController::setPriorityOfMetaurl(int priority)
|
||||
|
@ -606,12 +607,12 @@ void MetalinkParserController::setPriorityOfMetaurl(int priority)
|
|||
tMetaurl_->priority = priority;
|
||||
}
|
||||
|
||||
void MetalinkParserController::setNameOfMetaurl(const std::string& name)
|
||||
void MetalinkParserController::setNameOfMetaurl(std::string name)
|
||||
{
|
||||
if(!tMetaurl_) {
|
||||
return;
|
||||
}
|
||||
tMetaurl_->name = name;
|
||||
tMetaurl_->name = std::move(name);
|
||||
}
|
||||
|
||||
void MetalinkParserController::commitMetaurlTransaction()
|
||||
|
|
|
@ -92,15 +92,15 @@ public:
|
|||
|
||||
void newEntryTransaction();
|
||||
|
||||
void setFileNameOfEntry(const std::string& filename);
|
||||
void setFileNameOfEntry(std::string filename);
|
||||
|
||||
void setFileLengthOfEntry(int64_t length);
|
||||
|
||||
void setVersionOfEntry(const std::string& version);
|
||||
void setVersionOfEntry(std::string version);
|
||||
|
||||
void setLanguageOfEntry(const std::string& language);
|
||||
void setLanguageOfEntry(std::string language);
|
||||
|
||||
void setOSOfEntry(const std::string& os);
|
||||
void setOSOfEntry(std::string os);
|
||||
|
||||
void setMaxConnectionsOfEntry(int maxConnections);
|
||||
|
||||
|
@ -110,11 +110,11 @@ public:
|
|||
|
||||
void newResourceTransaction();
|
||||
|
||||
void setURLOfResource(const std::string& url);
|
||||
void setURLOfResource(std::string url);
|
||||
|
||||
void setTypeOfResource(const std::string& type);
|
||||
void setTypeOfResource(std::string type);
|
||||
|
||||
void setLocationOfResource(const std::string& location);
|
||||
void setLocationOfResource(std::string location);
|
||||
|
||||
void setPriorityOfResource(int priority);
|
||||
|
||||
|
@ -126,9 +126,9 @@ public:
|
|||
|
||||
void newChecksumTransaction();
|
||||
|
||||
void setTypeOfChecksum(const std::string& type);
|
||||
void setTypeOfChecksum(std::string type);
|
||||
|
||||
void setHashOfChecksum(const std::string& md);
|
||||
void setHashOfChecksum(std::string md);
|
||||
|
||||
void commitChecksumTransaction();
|
||||
|
||||
|
@ -136,11 +136,11 @@ public:
|
|||
|
||||
void newChunkChecksumTransactionV4(); // Metalink4Spec
|
||||
|
||||
void setTypeOfChunkChecksumV4(const std::string& type); // Metalink4Spec
|
||||
void setTypeOfChunkChecksumV4(std::string type); // Metalink4Spec
|
||||
|
||||
void setLengthOfChunkChecksumV4(size_t length); // Metalink4Spec
|
||||
|
||||
void addHashOfChunkChecksumV4(const std::string& md); // Metalink4Spec
|
||||
void addHashOfChunkChecksumV4(std::string md); // Metalink4Spec
|
||||
|
||||
void commitChunkChecksumTransactionV4(); // Metalink4Spec
|
||||
|
||||
|
@ -148,15 +148,15 @@ public:
|
|||
|
||||
void newChunkChecksumTransaction(); // Metalink3Spec
|
||||
|
||||
void setTypeOfChunkChecksum(const std::string& type); // Metalink3Spec
|
||||
void setTypeOfChunkChecksum(std::string type); // Metalink3Spec
|
||||
|
||||
void setLengthOfChunkChecksum(size_t length); // Metalink3Spec
|
||||
|
||||
void addHashOfChunkChecksum(size_t order, const std::string& md);// Metalink3Spec
|
||||
void addHashOfChunkChecksum(size_t order, std::string md);// Metalink3Spec
|
||||
|
||||
void createNewHashOfChunkChecksum(size_t order); // Metalink3Spec
|
||||
|
||||
void setMessageDigestOfChunkChecksum(const std::string& md); // Metalink3Spec
|
||||
void setMessageDigestOfChunkChecksum(std::string md); // Metalink3Spec
|
||||
|
||||
void addHashOfChunkChecksum(); // Metalink3Spec
|
||||
|
||||
|
@ -166,11 +166,11 @@ public:
|
|||
|
||||
void newSignatureTransaction();
|
||||
|
||||
void setTypeOfSignature(const std::string& type);
|
||||
void setTypeOfSignature(std::string type);
|
||||
|
||||
void setFileOfSignature(const std::string& file);
|
||||
void setFileOfSignature(std::string file);
|
||||
|
||||
void setBodyOfSignature(const std::string& body);
|
||||
void setBodyOfSignature(std::string body);
|
||||
|
||||
void commitSignatureTransaction();
|
||||
|
||||
|
@ -178,21 +178,21 @@ public:
|
|||
|
||||
void newMetaurlTransaction();
|
||||
|
||||
void setURLOfMetaurl(const std::string& url);
|
||||
void setURLOfMetaurl(std::string url);
|
||||
|
||||
void setMediatypeOfMetaurl(const std::string& mediatype);
|
||||
void setMediatypeOfMetaurl(std::string mediatype);
|
||||
|
||||
void setPriorityOfMetaurl(int priority);
|
||||
|
||||
void setNameOfMetaurl(const std::string& name);
|
||||
void setNameOfMetaurl(std::string name);
|
||||
|
||||
void commitMetaurlTransaction();
|
||||
|
||||
void cancelMetaurlTransaction();
|
||||
|
||||
void setBaseUri(const std::string& baseUri)
|
||||
void setBaseUri(std::string baseUri)
|
||||
{
|
||||
baseUri_ = baseUri;
|
||||
baseUri_ = std::move(baseUri);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ public:
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters) {}
|
||||
std::string characters) {}
|
||||
|
||||
virtual bool needsCharactersBuffering() const
|
||||
{
|
||||
|
|
|
@ -268,9 +268,9 @@ void MetalinkParserStateMachine::newEntryTransaction()
|
|||
ctrl_->newEntryTransaction();
|
||||
}
|
||||
|
||||
void MetalinkParserStateMachine::setFileNameOfEntry(const std::string& filename)
|
||||
void MetalinkParserStateMachine::setFileNameOfEntry(std::string filename)
|
||||
{
|
||||
ctrl_->setFileNameOfEntry(filename);
|
||||
ctrl_->setFileNameOfEntry(std::move(filename));
|
||||
}
|
||||
|
||||
void MetalinkParserStateMachine::setFileLengthOfEntry(int64_t length)
|
||||
|
@ -278,19 +278,19 @@ void MetalinkParserStateMachine::setFileLengthOfEntry(int64_t length)
|
|||
ctrl_->setFileLengthOfEntry(length);
|
||||
}
|
||||
|
||||
void MetalinkParserStateMachine::setVersionOfEntry(const std::string& version)
|
||||
void MetalinkParserStateMachine::setVersionOfEntry(std::string version)
|
||||
{
|
||||
ctrl_->setVersionOfEntry(version);
|
||||
ctrl_->setVersionOfEntry(std::move(version));
|
||||
}
|
||||
|
||||
void MetalinkParserStateMachine::setLanguageOfEntry(const std::string& language)
|
||||
void MetalinkParserStateMachine::setLanguageOfEntry(std::string language)
|
||||
{
|
||||
ctrl_->setLanguageOfEntry(language);
|
||||
ctrl_->setLanguageOfEntry(std::move(language));
|
||||
}
|
||||
|
||||
void MetalinkParserStateMachine::setOSOfEntry(const std::string& os)
|
||||
void MetalinkParserStateMachine::setOSOfEntry(std::string os)
|
||||
{
|
||||
ctrl_->setOSOfEntry(os);
|
||||
ctrl_->setOSOfEntry(std::move(os));
|
||||
}
|
||||
|
||||
void MetalinkParserStateMachine::setMaxConnectionsOfEntry(int maxConnections)
|
||||
|
@ -313,20 +313,19 @@ void MetalinkParserStateMachine::newResourceTransaction()
|
|||
ctrl_->newResourceTransaction();
|
||||
}
|
||||
|
||||
void MetalinkParserStateMachine::setURLOfResource(const std::string& url)
|
||||
void MetalinkParserStateMachine::setURLOfResource(std::string url)
|
||||
{
|
||||
ctrl_->setURLOfResource(url);
|
||||
ctrl_->setURLOfResource(std::move(url));
|
||||
}
|
||||
|
||||
void MetalinkParserStateMachine::setTypeOfResource(const std::string& type)
|
||||
void MetalinkParserStateMachine::setTypeOfResource(std::string type)
|
||||
{
|
||||
ctrl_->setTypeOfResource(type);
|
||||
ctrl_->setTypeOfResource(std::move(type));
|
||||
}
|
||||
|
||||
void MetalinkParserStateMachine::setLocationOfResource
|
||||
(const std::string& location)
|
||||
void MetalinkParserStateMachine::setLocationOfResource(std::string location)
|
||||
{
|
||||
ctrl_->setLocationOfResource(location);
|
||||
ctrl_->setLocationOfResource(std::move(location));
|
||||
}
|
||||
|
||||
void MetalinkParserStateMachine::setPriorityOfResource(int priority)
|
||||
|
@ -354,14 +353,14 @@ void MetalinkParserStateMachine::newChecksumTransaction()
|
|||
ctrl_->newChecksumTransaction();
|
||||
}
|
||||
|
||||
void MetalinkParserStateMachine::setTypeOfChecksum(const std::string& type)
|
||||
void MetalinkParserStateMachine::setTypeOfChecksum(std::string type)
|
||||
{
|
||||
ctrl_->setTypeOfChecksum(type);
|
||||
ctrl_->setTypeOfChecksum(std::move(type));
|
||||
}
|
||||
|
||||
void MetalinkParserStateMachine::setHashOfChecksum(const std::string& md)
|
||||
void MetalinkParserStateMachine::setHashOfChecksum(std::string md)
|
||||
{
|
||||
ctrl_->setHashOfChecksum(md);
|
||||
ctrl_->setHashOfChecksum(std::move(md));
|
||||
}
|
||||
|
||||
void MetalinkParserStateMachine::commitChecksumTransaction()
|
||||
|
@ -384,15 +383,14 @@ void MetalinkParserStateMachine::setLengthOfChunkChecksumV4(size_t length)
|
|||
ctrl_->setLengthOfChunkChecksumV4(length);
|
||||
}
|
||||
|
||||
void MetalinkParserStateMachine::setTypeOfChunkChecksumV4
|
||||
(const std::string& type)
|
||||
void MetalinkParserStateMachine::setTypeOfChunkChecksumV4(std::string type)
|
||||
{
|
||||
ctrl_->setTypeOfChunkChecksumV4(type);
|
||||
ctrl_->setTypeOfChunkChecksumV4(std::move(type));
|
||||
}
|
||||
|
||||
void MetalinkParserStateMachine::addHashOfChunkChecksumV4(const std::string& md)
|
||||
void MetalinkParserStateMachine::addHashOfChunkChecksumV4(std::string md)
|
||||
{
|
||||
ctrl_->addHashOfChunkChecksumV4(md);
|
||||
ctrl_->addHashOfChunkChecksumV4(std::move(md));
|
||||
}
|
||||
|
||||
void MetalinkParserStateMachine::commitChunkChecksumTransactionV4()
|
||||
|
@ -415,9 +413,9 @@ void MetalinkParserStateMachine::setLengthOfChunkChecksum(size_t length)
|
|||
ctrl_->setLengthOfChunkChecksum(length);
|
||||
}
|
||||
|
||||
void MetalinkParserStateMachine::setTypeOfChunkChecksum(const std::string& type)
|
||||
void MetalinkParserStateMachine::setTypeOfChunkChecksum(std::string type)
|
||||
{
|
||||
ctrl_->setTypeOfChunkChecksum(type);
|
||||
ctrl_->setTypeOfChunkChecksum(std::move(type));
|
||||
}
|
||||
|
||||
void MetalinkParserStateMachine::createNewHashOfChunkChecksum(size_t order)
|
||||
|
@ -425,10 +423,9 @@ void MetalinkParserStateMachine::createNewHashOfChunkChecksum(size_t order)
|
|||
ctrl_->createNewHashOfChunkChecksum(order);
|
||||
}
|
||||
|
||||
void MetalinkParserStateMachine::setMessageDigestOfChunkChecksum
|
||||
(const std::string& md)
|
||||
void MetalinkParserStateMachine::setMessageDigestOfChunkChecksum(std::string md)
|
||||
{
|
||||
ctrl_->setMessageDigestOfChunkChecksum(md);
|
||||
ctrl_->setMessageDigestOfChunkChecksum(std::move(md));
|
||||
}
|
||||
|
||||
void MetalinkParserStateMachine::addHashOfChunkChecksum()
|
||||
|
@ -451,19 +448,19 @@ void MetalinkParserStateMachine::newSignatureTransaction()
|
|||
ctrl_->newSignatureTransaction();
|
||||
}
|
||||
|
||||
void MetalinkParserStateMachine::setTypeOfSignature(const std::string& type)
|
||||
void MetalinkParserStateMachine::setTypeOfSignature(std::string type)
|
||||
{
|
||||
ctrl_->setTypeOfSignature(type);
|
||||
ctrl_->setTypeOfSignature(std::move(type));
|
||||
}
|
||||
|
||||
void MetalinkParserStateMachine::setFileOfSignature(const std::string& file)
|
||||
void MetalinkParserStateMachine::setFileOfSignature(std::string file)
|
||||
{
|
||||
ctrl_->setFileOfSignature(file);
|
||||
ctrl_->setFileOfSignature(std::move(file));
|
||||
}
|
||||
|
||||
void MetalinkParserStateMachine::setBodyOfSignature(const std::string& body)
|
||||
void MetalinkParserStateMachine::setBodyOfSignature(std::string body)
|
||||
{
|
||||
ctrl_->setBodyOfSignature(body);
|
||||
ctrl_->setBodyOfSignature(std::move(body));
|
||||
}
|
||||
|
||||
void MetalinkParserStateMachine::commitSignatureTransaction()
|
||||
|
@ -481,15 +478,14 @@ void MetalinkParserStateMachine::newMetaurlTransaction()
|
|||
ctrl_->newMetaurlTransaction();
|
||||
}
|
||||
|
||||
void MetalinkParserStateMachine::setURLOfMetaurl(const std::string& url)
|
||||
void MetalinkParserStateMachine::setURLOfMetaurl(std::string url)
|
||||
{
|
||||
ctrl_->setURLOfMetaurl(url);
|
||||
ctrl_->setURLOfMetaurl(std::move(url));
|
||||
}
|
||||
|
||||
void MetalinkParserStateMachine::setMediatypeOfMetaurl
|
||||
(const std::string& mediatype)
|
||||
void MetalinkParserStateMachine::setMediatypeOfMetaurl(std::string mediatype)
|
||||
{
|
||||
ctrl_->setMediatypeOfMetaurl(mediatype);
|
||||
ctrl_->setMediatypeOfMetaurl(std::move(mediatype));
|
||||
}
|
||||
|
||||
void MetalinkParserStateMachine::setPriorityOfMetaurl(int priority)
|
||||
|
@ -497,9 +493,9 @@ void MetalinkParserStateMachine::setPriorityOfMetaurl(int priority)
|
|||
ctrl_->setPriorityOfMetaurl(priority);
|
||||
}
|
||||
|
||||
void MetalinkParserStateMachine::setNameOfMetaurl(const std::string& name)
|
||||
void MetalinkParserStateMachine::setNameOfMetaurl(std::string name)
|
||||
{
|
||||
ctrl_->setNameOfMetaurl(name);
|
||||
ctrl_->setNameOfMetaurl(std::move(name));
|
||||
}
|
||||
|
||||
void MetalinkParserStateMachine::commitMetaurlTransaction()
|
||||
|
@ -525,9 +521,10 @@ void MetalinkParserStateMachine::endElement
|
|||
(const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters)
|
||||
std::string characters)
|
||||
{
|
||||
stateStack_.top()->endElement(this, localname, prefix, nsUri, characters);
|
||||
stateStack_.top()->endElement(this, localname, prefix, nsUri,
|
||||
std::move(characters));
|
||||
stateStack_.pop();
|
||||
}
|
||||
|
||||
|
@ -536,10 +533,10 @@ bool MetalinkParserStateMachine::needsCharactersBuffering() const
|
|||
return stateStack_.top()->needsCharactersBuffering();
|
||||
}
|
||||
|
||||
void MetalinkParserStateMachine::logError(const std::string& log)
|
||||
void MetalinkParserStateMachine::logError(std::string log)
|
||||
{
|
||||
if(errors_.size() < 10) {
|
||||
errors_.push_back(log);
|
||||
errors_.push_back(std::move(log));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -557,9 +554,9 @@ std::unique_ptr<Metalinker> MetalinkParserStateMachine::getResult()
|
|||
return ctrl_->getResult();
|
||||
}
|
||||
|
||||
void MetalinkParserStateMachine::setBaseUri(const std::string& uri)
|
||||
void MetalinkParserStateMachine::setBaseUri(std::string uri)
|
||||
{
|
||||
ctrl_->setBaseUri(uri);
|
||||
ctrl_->setBaseUri(std::move(uri));
|
||||
}
|
||||
|
||||
} // namespace aria2
|
||||
|
|
|
@ -109,7 +109,7 @@ public:
|
|||
(const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters) CXX11_OVERRIDE;
|
||||
std::string characters) CXX11_OVERRIDE;
|
||||
|
||||
virtual void reset() CXX11_OVERRIDE;
|
||||
|
||||
|
@ -159,15 +159,15 @@ public:
|
|||
|
||||
void newEntryTransaction();
|
||||
|
||||
void setFileNameOfEntry(const std::string& filename);
|
||||
void setFileNameOfEntry(std::string filename);
|
||||
|
||||
void setFileLengthOfEntry(int64_t length);
|
||||
|
||||
void setVersionOfEntry(const std::string& version);
|
||||
void setVersionOfEntry(std::string version);
|
||||
|
||||
void setLanguageOfEntry(const std::string& language);
|
||||
void setLanguageOfEntry(std::string language);
|
||||
|
||||
void setOSOfEntry(const std::string& os);
|
||||
void setOSOfEntry(std::string os);
|
||||
|
||||
void setMaxConnectionsOfEntry(int maxConnections); // Metalink3Spec
|
||||
|
||||
|
@ -177,11 +177,11 @@ public:
|
|||
|
||||
void newResourceTransaction();
|
||||
|
||||
void setURLOfResource(const std::string& url);
|
||||
void setURLOfResource(std::string url);
|
||||
|
||||
void setTypeOfResource(const std::string& type);
|
||||
void setTypeOfResource(std::string type);
|
||||
|
||||
void setLocationOfResource(const std::string& location);
|
||||
void setLocationOfResource(std::string location);
|
||||
|
||||
void setPriorityOfResource(int priority);
|
||||
|
||||
|
@ -193,9 +193,9 @@ public:
|
|||
|
||||
void newChecksumTransaction();
|
||||
|
||||
void setTypeOfChecksum(const std::string& type);
|
||||
void setTypeOfChecksum(std::string type);
|
||||
|
||||
void setHashOfChecksum(const std::string& md);
|
||||
void setHashOfChecksum(std::string md);
|
||||
|
||||
void commitChecksumTransaction();
|
||||
|
||||
|
@ -205,9 +205,9 @@ public:
|
|||
|
||||
void setLengthOfChunkChecksumV4(size_t length); // Metalink4Spec
|
||||
|
||||
void setTypeOfChunkChecksumV4(const std::string& type); // Metalink4Spec
|
||||
void setTypeOfChunkChecksumV4(std::string type); // Metalink4Spec
|
||||
|
||||
void addHashOfChunkChecksumV4(const std::string& md); // Metalink4Spec
|
||||
void addHashOfChunkChecksumV4(std::string md); // Metalink4Spec
|
||||
|
||||
void commitChunkChecksumTransactionV4(); // Metalink4Spec
|
||||
|
||||
|
@ -217,11 +217,11 @@ public:
|
|||
|
||||
void setLengthOfChunkChecksum(size_t length); // Metalink3Spec
|
||||
|
||||
void setTypeOfChunkChecksum(const std::string& type); // Metalink3Spec
|
||||
void setTypeOfChunkChecksum(std::string type); // Metalink3Spec
|
||||
|
||||
void createNewHashOfChunkChecksum(size_t order); // Metalink3Spec
|
||||
|
||||
void setMessageDigestOfChunkChecksum(const std::string& md); // Metalink3Spec
|
||||
void setMessageDigestOfChunkChecksum(std::string md); // Metalink3Spec
|
||||
|
||||
void addHashOfChunkChecksum(); // Metalink3Spec
|
||||
|
||||
|
@ -231,11 +231,11 @@ public:
|
|||
|
||||
void newSignatureTransaction();
|
||||
|
||||
void setTypeOfSignature(const std::string& type);
|
||||
void setTypeOfSignature(std::string type);
|
||||
|
||||
void setFileOfSignature(const std::string& file);
|
||||
void setFileOfSignature(std::string file);
|
||||
|
||||
void setBodyOfSignature(const std::string& body);
|
||||
void setBodyOfSignature(std::string body);
|
||||
|
||||
void commitSignatureTransaction();
|
||||
|
||||
|
@ -243,20 +243,20 @@ public:
|
|||
|
||||
void newMetaurlTransaction();
|
||||
|
||||
void setURLOfMetaurl(const std::string& url);
|
||||
void setURLOfMetaurl(std::string url);
|
||||
|
||||
void setMediatypeOfMetaurl(const std::string& mediatype);
|
||||
void setMediatypeOfMetaurl(std::string mediatype);
|
||||
|
||||
void setPriorityOfMetaurl(int priority);
|
||||
|
||||
void setNameOfMetaurl(const std::string& name);
|
||||
void setNameOfMetaurl(std::string name);
|
||||
|
||||
void commitMetaurlTransaction();
|
||||
|
||||
void cancelMetaurlTransaction();
|
||||
|
||||
// Only stores first 10 errors.
|
||||
void logError(const std::string& log);
|
||||
void logError(std::string log);
|
||||
|
||||
const std::vector<std::string>& getErrors() const
|
||||
{
|
||||
|
@ -267,7 +267,7 @@ public:
|
|||
|
||||
std::unique_ptr<Metalinker> getResult();
|
||||
|
||||
void setBaseUri(const std::string& uri);
|
||||
void setBaseUri(std::string uri);
|
||||
};
|
||||
|
||||
} // namespace aria2
|
||||
|
|
|
@ -134,7 +134,7 @@ void FileMetalinkParserState::endElement
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters)
|
||||
std::string characters)
|
||||
{
|
||||
psm->commitEntryTransaction();
|
||||
}
|
||||
|
@ -144,7 +144,7 @@ void SizeMetalinkParserState::endElement
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters)
|
||||
std::string characters)
|
||||
{
|
||||
// current metalink specification doesn't require size element.
|
||||
int64_t size;
|
||||
|
@ -159,9 +159,9 @@ void VersionMetalinkParserState::endElement
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters)
|
||||
std::string characters)
|
||||
{
|
||||
psm->setVersionOfEntry(characters);
|
||||
psm->setVersionOfEntry(std::move(characters));
|
||||
}
|
||||
|
||||
void LanguageMetalinkParserState::endElement
|
||||
|
@ -169,9 +169,9 @@ void LanguageMetalinkParserState::endElement
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters)
|
||||
std::string characters)
|
||||
{
|
||||
psm->setLanguageOfEntry(characters);
|
||||
psm->setLanguageOfEntry(std::move(characters));
|
||||
}
|
||||
|
||||
void OSMetalinkParserState::endElement
|
||||
|
@ -179,9 +179,9 @@ void OSMetalinkParserState::endElement
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters)
|
||||
std::string characters)
|
||||
{
|
||||
psm->setOSOfEntry(characters);
|
||||
psm->setOSOfEntry(std::move(characters));
|
||||
}
|
||||
|
||||
void VerificationMetalinkParserState::beginElement
|
||||
|
@ -259,9 +259,9 @@ void HashMetalinkParserState::endElement
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters)
|
||||
std::string characters)
|
||||
{
|
||||
psm->setHashOfChecksum(characters);
|
||||
psm->setHashOfChecksum(std::move(characters));
|
||||
psm->commitChecksumTransaction();
|
||||
}
|
||||
|
||||
|
@ -296,7 +296,7 @@ void PiecesMetalinkParserState::endElement
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters)
|
||||
std::string characters)
|
||||
{
|
||||
psm->commitChunkChecksumTransaction();
|
||||
}
|
||||
|
@ -306,9 +306,9 @@ void PieceHashMetalinkParserState::endElement
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters)
|
||||
std::string characters)
|
||||
{
|
||||
psm->setMessageDigestOfChunkChecksum(characters);
|
||||
psm->setMessageDigestOfChunkChecksum(std::move(characters));
|
||||
psm->addHashOfChunkChecksum();
|
||||
}
|
||||
|
||||
|
@ -317,9 +317,9 @@ void SignatureMetalinkParserState::endElement
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters)
|
||||
std::string characters)
|
||||
{
|
||||
psm->setBodyOfSignature(characters);
|
||||
psm->setBodyOfSignature(std::move(characters));
|
||||
psm->commitSignatureTransaction();
|
||||
}
|
||||
|
||||
|
@ -391,9 +391,9 @@ void URLMetalinkParserState::endElement
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters)
|
||||
std::string characters)
|
||||
{
|
||||
psm->setURLOfResource(characters);
|
||||
psm->setURLOfResource(std::move(characters));
|
||||
psm->commitResourceTransaction();
|
||||
}
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ public:
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters) CXX11_OVERRIDE;
|
||||
std::string characters) CXX11_OVERRIDE;
|
||||
|
||||
virtual bool needsCharactersBuffering() const CXX11_OVERRIDE
|
||||
{
|
||||
|
@ -95,7 +95,7 @@ public:
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters) CXX11_OVERRIDE;
|
||||
std::string characters) CXX11_OVERRIDE;
|
||||
|
||||
virtual bool needsCharactersBuffering() const CXX11_OVERRIDE
|
||||
{
|
||||
|
@ -110,7 +110,7 @@ public:
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters) CXX11_OVERRIDE;
|
||||
std::string characters) CXX11_OVERRIDE;
|
||||
|
||||
virtual bool needsCharactersBuffering() const CXX11_OVERRIDE
|
||||
{
|
||||
|
@ -125,7 +125,7 @@ public:
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters) CXX11_OVERRIDE;
|
||||
std::string characters) CXX11_OVERRIDE;
|
||||
|
||||
virtual bool needsCharactersBuffering() const CXX11_OVERRIDE
|
||||
{
|
||||
|
@ -140,7 +140,7 @@ public:
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters) CXX11_OVERRIDE;
|
||||
std::string characters) CXX11_OVERRIDE;
|
||||
|
||||
virtual bool needsCharactersBuffering() const CXX11_OVERRIDE
|
||||
{
|
||||
|
@ -170,7 +170,7 @@ public:
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters) CXX11_OVERRIDE;
|
||||
std::string characters) CXX11_OVERRIDE;
|
||||
|
||||
virtual bool needsCharactersBuffering() const CXX11_OVERRIDE
|
||||
{
|
||||
|
@ -191,7 +191,7 @@ public:
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters) CXX11_OVERRIDE;
|
||||
std::string characters) CXX11_OVERRIDE;
|
||||
|
||||
virtual bool needsCharactersBuffering() const CXX11_OVERRIDE
|
||||
{
|
||||
|
@ -206,7 +206,7 @@ public:
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters) CXX11_OVERRIDE;
|
||||
std::string characters) CXX11_OVERRIDE;
|
||||
|
||||
virtual bool needsCharactersBuffering() const CXX11_OVERRIDE
|
||||
{
|
||||
|
@ -221,7 +221,7 @@ public:
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters) CXX11_OVERRIDE;
|
||||
std::string characters) CXX11_OVERRIDE;
|
||||
|
||||
virtual bool needsCharactersBuffering() const CXX11_OVERRIDE
|
||||
{
|
||||
|
@ -251,7 +251,7 @@ public:
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters) CXX11_OVERRIDE;
|
||||
std::string characters) CXX11_OVERRIDE;
|
||||
|
||||
virtual bool needsCharactersBuffering() const CXX11_OVERRIDE
|
||||
{
|
||||
|
|
|
@ -223,7 +223,7 @@ void FileMetalinkParserStateV4::endElement
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters)
|
||||
std::string characters)
|
||||
{
|
||||
psm->commitEntryTransaction();
|
||||
}
|
||||
|
@ -233,7 +233,7 @@ void SizeMetalinkParserStateV4::endElement
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters)
|
||||
std::string characters)
|
||||
{
|
||||
int64_t size;
|
||||
if(util::parseLLIntNoThrow(size, characters) && size >= 0 &&
|
||||
|
@ -250,9 +250,9 @@ void VersionMetalinkParserStateV4::endElement
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters)
|
||||
std::string characters)
|
||||
{
|
||||
psm->setVersionOfEntry(characters);
|
||||
psm->setVersionOfEntry(std::move(characters));
|
||||
}
|
||||
|
||||
void LanguageMetalinkParserStateV4::endElement
|
||||
|
@ -260,9 +260,9 @@ void LanguageMetalinkParserStateV4::endElement
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters)
|
||||
std::string characters)
|
||||
{
|
||||
psm->setLanguageOfEntry(characters);
|
||||
psm->setLanguageOfEntry(std::move(characters));
|
||||
}
|
||||
|
||||
void OSMetalinkParserStateV4::endElement
|
||||
|
@ -270,9 +270,9 @@ void OSMetalinkParserStateV4::endElement
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters)
|
||||
std::string characters)
|
||||
{
|
||||
psm->setOSOfEntry(characters);
|
||||
psm->setOSOfEntry(std::move(characters));
|
||||
}
|
||||
|
||||
void HashMetalinkParserStateV4::endElement
|
||||
|
@ -280,9 +280,9 @@ void HashMetalinkParserStateV4::endElement
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters)
|
||||
std::string characters)
|
||||
{
|
||||
psm->setHashOfChecksum(characters);
|
||||
psm->setHashOfChecksum(std::move(characters));
|
||||
psm->commitChecksumTransaction();
|
||||
}
|
||||
|
||||
|
@ -305,7 +305,7 @@ void PiecesMetalinkParserStateV4::endElement
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters)
|
||||
std::string characters)
|
||||
{
|
||||
psm->commitChunkChecksumTransactionV4();
|
||||
}
|
||||
|
@ -315,9 +315,9 @@ void PieceHashMetalinkParserStateV4::endElement
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters)
|
||||
std::string characters)
|
||||
{
|
||||
psm->addHashOfChunkChecksumV4(characters);
|
||||
psm->addHashOfChunkChecksumV4(std::move(characters));
|
||||
}
|
||||
|
||||
void SignatureMetalinkParserStateV4::endElement
|
||||
|
@ -325,9 +325,9 @@ void SignatureMetalinkParserStateV4::endElement
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters)
|
||||
std::string characters)
|
||||
{
|
||||
psm->setBodyOfSignature(characters);
|
||||
psm->setBodyOfSignature(std::move(characters));
|
||||
psm->commitSignatureTransaction();
|
||||
}
|
||||
|
||||
|
@ -336,9 +336,9 @@ void URLMetalinkParserStateV4::endElement
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters)
|
||||
std::string characters)
|
||||
{
|
||||
psm->setURLOfResource(characters);
|
||||
psm->setURLOfResource(std::move(characters));
|
||||
psm->commitResourceTransaction();
|
||||
}
|
||||
|
||||
|
@ -347,9 +347,9 @@ void MetaurlMetalinkParserStateV4::endElement
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters)
|
||||
std::string characters)
|
||||
{
|
||||
psm->setURLOfMetaurl(characters);
|
||||
psm->setURLOfMetaurl(std::move(characters));
|
||||
psm->commitMetaurlTransaction();
|
||||
}
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ public:
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters) CXX11_OVERRIDE;
|
||||
std::string characters) CXX11_OVERRIDE;
|
||||
|
||||
virtual bool needsCharactersBuffering() const CXX11_OVERRIDE
|
||||
{
|
||||
|
@ -80,7 +80,7 @@ public:
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters) CXX11_OVERRIDE;
|
||||
std::string characters) CXX11_OVERRIDE;
|
||||
|
||||
virtual bool needsCharactersBuffering() const CXX11_OVERRIDE
|
||||
{
|
||||
|
@ -95,7 +95,7 @@ public:
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters) CXX11_OVERRIDE;
|
||||
std::string characters) CXX11_OVERRIDE;
|
||||
|
||||
virtual bool needsCharactersBuffering() const CXX11_OVERRIDE
|
||||
{
|
||||
|
@ -110,7 +110,7 @@ public:
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters) CXX11_OVERRIDE;
|
||||
std::string characters) CXX11_OVERRIDE;
|
||||
|
||||
virtual bool needsCharactersBuffering() const CXX11_OVERRIDE
|
||||
{
|
||||
|
@ -125,7 +125,7 @@ public:
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters) CXX11_OVERRIDE;
|
||||
std::string characters) CXX11_OVERRIDE;
|
||||
|
||||
virtual bool needsCharactersBuffering() const CXX11_OVERRIDE
|
||||
{
|
||||
|
@ -140,7 +140,7 @@ public:
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters) CXX11_OVERRIDE;
|
||||
std::string characters) CXX11_OVERRIDE;
|
||||
|
||||
virtual bool needsCharactersBuffering() const CXX11_OVERRIDE
|
||||
{
|
||||
|
@ -161,7 +161,7 @@ public:
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters) CXX11_OVERRIDE;
|
||||
std::string characters) CXX11_OVERRIDE;
|
||||
|
||||
virtual bool needsCharactersBuffering() const CXX11_OVERRIDE
|
||||
{
|
||||
|
@ -176,7 +176,7 @@ public:
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters) CXX11_OVERRIDE;
|
||||
std::string characters) CXX11_OVERRIDE;
|
||||
|
||||
virtual bool needsCharactersBuffering() const CXX11_OVERRIDE
|
||||
{
|
||||
|
@ -191,7 +191,7 @@ public:
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters) CXX11_OVERRIDE;
|
||||
std::string characters) CXX11_OVERRIDE;
|
||||
|
||||
virtual bool needsCharactersBuffering() const CXX11_OVERRIDE
|
||||
{
|
||||
|
@ -206,7 +206,7 @@ public:
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters) CXX11_OVERRIDE;
|
||||
std::string characters) CXX11_OVERRIDE;
|
||||
|
||||
virtual bool needsCharactersBuffering() const CXX11_OVERRIDE
|
||||
{
|
||||
|
@ -221,7 +221,7 @@ public:
|
|||
const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters) CXX11_OVERRIDE;
|
||||
std::string characters) CXX11_OVERRIDE;
|
||||
|
||||
virtual bool needsCharactersBuffering() const CXX11_OVERRIDE
|
||||
{
|
||||
|
|
|
@ -62,7 +62,7 @@ public:
|
|||
(const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters) = 0;
|
||||
std::string characters) = 0;
|
||||
|
||||
// Resets internal state of the object and make it ready for new
|
||||
// parser session.
|
||||
|
|
|
@ -42,19 +42,19 @@ Signature::Signature() {}
|
|||
|
||||
Signature::~Signature() {}
|
||||
|
||||
void Signature::setType(const std::string& type)
|
||||
void Signature::setType(std::string type)
|
||||
{
|
||||
type_ = type;
|
||||
type_ = std::move(type);
|
||||
}
|
||||
|
||||
void Signature::setFile(const std::string& file)
|
||||
void Signature::setFile(std::string file)
|
||||
{
|
||||
file_ = file;
|
||||
file_ = std::move(file);
|
||||
}
|
||||
|
||||
void Signature::setBody(const std::string& body)
|
||||
void Signature::setBody(std::string body)
|
||||
{
|
||||
body_ = body;
|
||||
body_ = std::move(body);
|
||||
}
|
||||
|
||||
bool Signature::save(const std::string& filepath) const
|
||||
|
|
|
@ -53,21 +53,21 @@ public:
|
|||
|
||||
~Signature();
|
||||
|
||||
void setType(const std::string& type);
|
||||
void setType(std::string type);
|
||||
|
||||
const std::string& getType() const
|
||||
{
|
||||
return type_;
|
||||
}
|
||||
|
||||
void setFile(const std::string& file);
|
||||
void setFile(std::string file);
|
||||
|
||||
const std::string& getFile() const
|
||||
{
|
||||
return file_;
|
||||
}
|
||||
|
||||
void setBody(const std::string& body);
|
||||
void setBody(std::string body);
|
||||
|
||||
const std::string& getBody() const
|
||||
{
|
||||
|
|
|
@ -97,7 +97,7 @@ void mlEndElement
|
|||
SessionData* sd = reinterpret_cast<SessionData*>(userData);
|
||||
std::string characters;
|
||||
if(sd->psm->needsCharactersBuffering()) {
|
||||
characters = sd->charactersStack.front();
|
||||
characters = std::move(sd->charactersStack.front());
|
||||
sd->charactersStack.pop_front();
|
||||
}
|
||||
sd->psm->endElement
|
||||
|
|
|
@ -58,7 +58,7 @@ public:
|
|||
|
||||
virtual void endElement(XmlRpcRequestParserStateMachine* psm,
|
||||
const char* name,
|
||||
const std::string& characters) = 0;
|
||||
std::string characters) = 0;
|
||||
|
||||
virtual bool needsCharactersBuffering() const = 0;
|
||||
};
|
||||
|
|
|
@ -63,7 +63,7 @@ void InitialXmlRpcRequestParserState::beginElement
|
|||
void InitialXmlRpcRequestParserState::endElement
|
||||
(XmlRpcRequestParserStateMachine* psm,
|
||||
const char* name,
|
||||
const std::string& characters)
|
||||
std::string characters)
|
||||
{}
|
||||
|
||||
// UnknownElementXmlRpcRequestParserState
|
||||
|
@ -106,9 +106,9 @@ void MethodNameXmlRpcRequestParserState::beginElement
|
|||
void MethodNameXmlRpcRequestParserState::endElement
|
||||
(XmlRpcRequestParserStateMachine* psm,
|
||||
const char* name,
|
||||
const std::string& characters)
|
||||
std::string characters)
|
||||
{
|
||||
psm->setMethodName(characters);
|
||||
psm->setMethodName(std::move(characters));
|
||||
}
|
||||
|
||||
// ParamsXmlRpcRequestParserState
|
||||
|
@ -143,7 +143,7 @@ void ParamXmlRpcRequestParserState::beginElement
|
|||
void ParamXmlRpcRequestParserState::endElement
|
||||
(XmlRpcRequestParserStateMachine* psm,
|
||||
const char* name,
|
||||
const std::string& characters)
|
||||
std::string characters)
|
||||
{
|
||||
psm->popArrayFrame();
|
||||
}
|
||||
|
@ -175,13 +175,13 @@ void ValueXmlRpcRequestParserState::beginElement
|
|||
void ValueXmlRpcRequestParserState::endElement
|
||||
(XmlRpcRequestParserStateMachine* psm,
|
||||
const char* name,
|
||||
const std::string& characters)
|
||||
std::string characters)
|
||||
{
|
||||
// XML-RPC specification says that if no data type tag is used, the
|
||||
// data must be treated as string. To prevent from overwriting
|
||||
// current frame value, we first check it is still null.
|
||||
if(!psm->getCurrentFrameValue() && !characters.empty()) {
|
||||
psm->setCurrentFrameValue(String::g(characters));
|
||||
psm->setCurrentFrameValue(String::g(std::move(characters)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -198,7 +198,7 @@ void IntXmlRpcRequestParserState::beginElement
|
|||
void IntXmlRpcRequestParserState::endElement
|
||||
(XmlRpcRequestParserStateMachine* psm,
|
||||
const char* name,
|
||||
const std::string& characters)
|
||||
std::string characters)
|
||||
{
|
||||
int32_t value;
|
||||
if(util::parseIntNoThrow(value, characters)) {
|
||||
|
@ -221,9 +221,9 @@ void StringXmlRpcRequestParserState::beginElement
|
|||
void StringXmlRpcRequestParserState::endElement
|
||||
(XmlRpcRequestParserStateMachine* psm,
|
||||
const char* name,
|
||||
const std::string& characters)
|
||||
std::string characters)
|
||||
{
|
||||
psm->setCurrentFrameValue(String::g(characters));
|
||||
psm->setCurrentFrameValue(String::g(std::move(characters)));
|
||||
}
|
||||
|
||||
// Base64XmlRpcRequestParserState
|
||||
|
@ -239,7 +239,7 @@ void Base64XmlRpcRequestParserState::beginElement
|
|||
void Base64XmlRpcRequestParserState::endElement
|
||||
(XmlRpcRequestParserStateMachine* psm,
|
||||
const char* name,
|
||||
const std::string& characters)
|
||||
std::string characters)
|
||||
{
|
||||
psm->setCurrentFrameValue
|
||||
(String::g(base64::decode(characters.begin(), characters.end())));
|
||||
|
@ -279,7 +279,7 @@ void MemberXmlRpcRequestParserState::beginElement
|
|||
void MemberXmlRpcRequestParserState::endElement
|
||||
(XmlRpcRequestParserStateMachine* psm,
|
||||
const char* name,
|
||||
const std::string& characters)
|
||||
std::string characters)
|
||||
{
|
||||
psm->popStructFrame();
|
||||
}
|
||||
|
@ -297,9 +297,9 @@ void NameXmlRpcRequestParserState::beginElement
|
|||
void NameXmlRpcRequestParserState::endElement
|
||||
(XmlRpcRequestParserStateMachine* psm,
|
||||
const char* name,
|
||||
const std::string& characters)
|
||||
std::string characters)
|
||||
{
|
||||
psm->setCurrentFrameName(characters);
|
||||
psm->setCurrentFrameName(std::move(characters));
|
||||
}
|
||||
|
||||
// ArrayXmlRpcRequestParserState
|
||||
|
@ -336,9 +336,9 @@ void DataXmlRpcRequestParserState::beginElement
|
|||
void ArrayValueXmlRpcRequestParserState::endElement
|
||||
(XmlRpcRequestParserStateMachine* psm,
|
||||
const char* name,
|
||||
const std::string& characters)
|
||||
std::string characters)
|
||||
{
|
||||
ValueXmlRpcRequestParserState::endElement(psm, name, characters);
|
||||
ValueXmlRpcRequestParserState::endElement(psm, name, std::move(characters));
|
||||
psm->popArrayFrame();
|
||||
}
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ public:
|
|||
|
||||
virtual void endElement(XmlRpcRequestParserStateMachine* psm,
|
||||
const char* name,
|
||||
const std::string& characters) CXX11_OVERRIDE;
|
||||
std::string characters) CXX11_OVERRIDE;
|
||||
|
||||
virtual bool needsCharactersBuffering() const CXX11_OVERRIDE
|
||||
{ return false; }
|
||||
|
@ -63,7 +63,7 @@ public:
|
|||
|
||||
virtual void endElement(XmlRpcRequestParserStateMachine* psm,
|
||||
const char* name,
|
||||
const std::string& characters) CXX11_OVERRIDE {}
|
||||
std::string characters) CXX11_OVERRIDE {}
|
||||
|
||||
virtual bool needsCharactersBuffering() const CXX11_OVERRIDE
|
||||
{ return false; }
|
||||
|
@ -77,7 +77,7 @@ public:
|
|||
|
||||
virtual void endElement(XmlRpcRequestParserStateMachine* psm,
|
||||
const char* name,
|
||||
const std::string& characters) CXX11_OVERRIDE {}
|
||||
std::string characters) CXX11_OVERRIDE {}
|
||||
|
||||
virtual bool needsCharactersBuffering() const CXX11_OVERRIDE
|
||||
{ return false; }
|
||||
|
@ -91,7 +91,7 @@ public:
|
|||
|
||||
virtual void endElement(XmlRpcRequestParserStateMachine* psm,
|
||||
const char* name,
|
||||
const std::string& characters) CXX11_OVERRIDE;
|
||||
std::string characters) CXX11_OVERRIDE;
|
||||
|
||||
virtual bool needsCharactersBuffering() const CXX11_OVERRIDE { return true; }
|
||||
};
|
||||
|
@ -103,7 +103,7 @@ class ParamsXmlRpcRequestParserState:public XmlRpcRequestParserState {
|
|||
|
||||
virtual void endElement(XmlRpcRequestParserStateMachine* psm,
|
||||
const char* name,
|
||||
const std::string& characters) CXX11_OVERRIDE {}
|
||||
std::string characters) CXX11_OVERRIDE {}
|
||||
|
||||
virtual bool needsCharactersBuffering() const CXX11_OVERRIDE
|
||||
{ return false; }
|
||||
|
@ -116,7 +116,7 @@ class ParamXmlRpcRequestParserState:public XmlRpcRequestParserState {
|
|||
|
||||
virtual void endElement(XmlRpcRequestParserStateMachine* psm,
|
||||
const char* name,
|
||||
const std::string& characters) CXX11_OVERRIDE;
|
||||
std::string characters) CXX11_OVERRIDE;
|
||||
|
||||
virtual bool needsCharactersBuffering() const CXX11_OVERRIDE
|
||||
{ return false; }
|
||||
|
@ -129,7 +129,7 @@ class ValueXmlRpcRequestParserState:public XmlRpcRequestParserState {
|
|||
protected:
|
||||
virtual void endElement(XmlRpcRequestParserStateMachine* psm,
|
||||
const char* name,
|
||||
const std::string& characters) CXX11_OVERRIDE;
|
||||
std::string characters) CXX11_OVERRIDE;
|
||||
|
||||
virtual bool needsCharactersBuffering() const CXX11_OVERRIDE { return true; }
|
||||
};
|
||||
|
@ -141,7 +141,7 @@ class IntXmlRpcRequestParserState:public XmlRpcRequestParserState {
|
|||
|
||||
virtual void endElement(XmlRpcRequestParserStateMachine* psm,
|
||||
const char* name,
|
||||
const std::string& characters) CXX11_OVERRIDE;
|
||||
std::string characters) CXX11_OVERRIDE;
|
||||
|
||||
virtual bool needsCharactersBuffering() const CXX11_OVERRIDE { return true; }
|
||||
};
|
||||
|
@ -153,7 +153,7 @@ class StringXmlRpcRequestParserState:public XmlRpcRequestParserState {
|
|||
|
||||
virtual void endElement(XmlRpcRequestParserStateMachine* psm,
|
||||
const char* name,
|
||||
const std::string& characters) CXX11_OVERRIDE;
|
||||
std::string characters) CXX11_OVERRIDE;
|
||||
|
||||
virtual bool needsCharactersBuffering() const CXX11_OVERRIDE { return true; }
|
||||
};
|
||||
|
@ -165,7 +165,7 @@ class Base64XmlRpcRequestParserState:public XmlRpcRequestParserState {
|
|||
|
||||
virtual void endElement(XmlRpcRequestParserStateMachine* psm,
|
||||
const char* name,
|
||||
const std::string& characters) CXX11_OVERRIDE;
|
||||
std::string characters) CXX11_OVERRIDE;
|
||||
|
||||
virtual bool needsCharactersBuffering() const CXX11_OVERRIDE { return true; }
|
||||
};
|
||||
|
@ -177,7 +177,7 @@ class StructXmlRpcRequestParserState:public XmlRpcRequestParserState {
|
|||
|
||||
virtual void endElement(XmlRpcRequestParserStateMachine* psm,
|
||||
const char* name,
|
||||
const std::string& characters) CXX11_OVERRIDE {}
|
||||
std::string characters) CXX11_OVERRIDE {}
|
||||
|
||||
virtual bool needsCharactersBuffering() const CXX11_OVERRIDE
|
||||
{ return false; }
|
||||
|
@ -190,7 +190,7 @@ class MemberXmlRpcRequestParserState:public XmlRpcRequestParserState {
|
|||
|
||||
virtual void endElement(XmlRpcRequestParserStateMachine* psm,
|
||||
const char* name,
|
||||
const std::string& characters) CXX11_OVERRIDE;
|
||||
std::string characters) CXX11_OVERRIDE;
|
||||
|
||||
virtual bool needsCharactersBuffering() const CXX11_OVERRIDE
|
||||
{ return false; }
|
||||
|
@ -203,7 +203,7 @@ class NameXmlRpcRequestParserState:public XmlRpcRequestParserState {
|
|||
|
||||
virtual void endElement(XmlRpcRequestParserStateMachine* psm,
|
||||
const char* name,
|
||||
const std::string& characters) CXX11_OVERRIDE;
|
||||
std::string characters) CXX11_OVERRIDE;
|
||||
|
||||
virtual bool needsCharactersBuffering() const CXX11_OVERRIDE { return true; }
|
||||
};
|
||||
|
@ -215,7 +215,7 @@ class ArrayXmlRpcRequestParserState:public XmlRpcRequestParserState {
|
|||
|
||||
virtual void endElement(XmlRpcRequestParserStateMachine* psm,
|
||||
const char* name,
|
||||
const std::string& characters) CXX11_OVERRIDE {}
|
||||
std::string characters) CXX11_OVERRIDE {}
|
||||
|
||||
virtual bool needsCharactersBuffering() const CXX11_OVERRIDE
|
||||
{ return false; }
|
||||
|
@ -228,7 +228,7 @@ class DataXmlRpcRequestParserState:public XmlRpcRequestParserState {
|
|||
|
||||
virtual void endElement(XmlRpcRequestParserStateMachine* psm,
|
||||
const char* name,
|
||||
const std::string& characters) CXX11_OVERRIDE {}
|
||||
std::string characters) CXX11_OVERRIDE {}
|
||||
|
||||
virtual bool needsCharactersBuffering() const CXX11_OVERRIDE
|
||||
{ return false; }
|
||||
|
@ -237,7 +237,7 @@ class DataXmlRpcRequestParserState:public XmlRpcRequestParserState {
|
|||
class ArrayValueXmlRpcRequestParserState:public ValueXmlRpcRequestParserState {
|
||||
virtual void endElement(XmlRpcRequestParserStateMachine* psm,
|
||||
const char* name,
|
||||
const std::string& characters) CXX11_OVERRIDE;
|
||||
std::string characters) CXX11_OVERRIDE;
|
||||
};
|
||||
|
||||
} // namespace rpc
|
||||
|
|
|
@ -117,16 +117,15 @@ void XmlRpcRequestParserStateMachine::endElement
|
|||
(const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters)
|
||||
std::string characters)
|
||||
{
|
||||
stateStack_.top()->endElement(this, localname, characters);
|
||||
stateStack_.top()->endElement(this, localname, std::move(characters));
|
||||
stateStack_.pop();
|
||||
}
|
||||
|
||||
void XmlRpcRequestParserStateMachine::setMethodName
|
||||
(const std::string& methodName)
|
||||
void XmlRpcRequestParserStateMachine::setMethodName(std::string methodName)
|
||||
{
|
||||
controller_->setMethodName(methodName);
|
||||
controller_->setMethodName(std::move(methodName));
|
||||
}
|
||||
|
||||
const std::string& XmlRpcRequestParserStateMachine::getMethodName() const
|
||||
|
@ -167,10 +166,9 @@ XmlRpcRequestParserStateMachine::popCurrentFrameValue()
|
|||
return controller_->popCurrentFrameValue();
|
||||
}
|
||||
|
||||
void XmlRpcRequestParserStateMachine::setCurrentFrameName
|
||||
(const std::string& name)
|
||||
void XmlRpcRequestParserStateMachine::setCurrentFrameName(std::string name)
|
||||
{
|
||||
controller_->setCurrentFrameName(name);
|
||||
controller_->setCurrentFrameName(std::move(name));
|
||||
}
|
||||
|
||||
void XmlRpcRequestParserStateMachine::pushUnknownElementState()
|
||||
|
|
|
@ -68,11 +68,11 @@ public:
|
|||
(const char* localname,
|
||||
const char* prefix,
|
||||
const char* nsUri,
|
||||
const std::string& characters) CXX11_OVERRIDE;
|
||||
std::string characters) CXX11_OVERRIDE;
|
||||
|
||||
virtual void reset() CXX11_OVERRIDE;
|
||||
|
||||
void setMethodName(const std::string& methodName);
|
||||
void setMethodName(std::string methodName);
|
||||
const std::string& getMethodName() const;
|
||||
void popArrayFrame();
|
||||
void popStructFrame();
|
||||
|
@ -80,7 +80,7 @@ public:
|
|||
void setCurrentFrameValue(std::unique_ptr<ValueBase> value);
|
||||
const std::unique_ptr<ValueBase>& getCurrentFrameValue() const;
|
||||
std::unique_ptr<ValueBase> popCurrentFrameValue();
|
||||
void setCurrentFrameName(const std::string& name);
|
||||
void setCurrentFrameName(std::string name);
|
||||
|
||||
void pushUnknownElementState();
|
||||
void pushMethodCallState();
|
||||
|
|
Loading…
Reference in New Issue