RenameJointCommand.cpp dnacalib/commands/RenameJointCommand.h dnacalib/commands/RenameResourceCommand.h dnacalib/dna/DNACalibDNAReaderImpl.h dnacalib/types/Aliases.h cstring dnac::RenameJointCommand::Impl dnac //CopyrightEpicGames,Inc.AllRightsReserved. #include"dnacalib/commands/RenameJointCommand.h" #include"dnacalib/commands/RenameResourceCommand.h" #include"dnacalib/dna/DNACalibDNAReaderImpl.h" #include"dnacalib/types/Aliases.h" #include<cstring> namespacednac{ #ifdef__clang__ #pragmaclangdiagnosticpush #pragmaclangdiagnosticignored"-Wweak-vtables" #endif classRenameJointCommand::Impl:publicRenameResourceCommand<Impl>{ private: usingSuper=RenameResourceCommand<Impl>; public: explicitImpl(MemoryResource*memRes_):Super{memRes_}{ } private: std::uint16_tgetNameCount(constdna::Reader*input)constoverride{ returninput->getJointCount(); } StringViewgetNameByIndex(constdna::Reader*input,std::uint16_tindex_)constoverride{ returninput->getJointName(index_); } voidsetNameByIndex(dna::Writer*output,std::uint16_tindex_,constchar*name)override{ output->setJointName(index_,name); } }; #ifdef__clang__ #pragmaclangdiagnosticpop #endif RenameJointCommand::RenameJointCommand(MemoryResource*memRes):pImpl{makeScoped<Impl>(memRes)}{ } RenameJointCommand::RenameJointCommand(std::uint16_tjointIndex,constchar*newName,MemoryResource*memRes): pImpl{makeScoped<Impl>(memRes)}{ pImpl->setName(jointIndex,newName); } RenameJointCommand::RenameJointCommand(constchar*oldName,constchar*newName,MemoryResource*memRes): pImpl{makeScoped<Impl>(memRes)}{ pImpl->setName(oldName,newName); } RenameJointCommand::~RenameJointCommand()=default; RenameJointCommand::RenameJointCommand(RenameJointCommand&&)=default; RenameJointCommand&RenameJointCommand::operator=(RenameJointCommand&&)=default; voidRenameJointCommand::setName(std::uint16_tjointIndex,constchar*newName){ pImpl->setName(jointIndex,newName); } voidRenameJointCommand::setName(constchar*oldName,constchar*newName){ pImpl->setName(oldName,newName); } voidRenameJointCommand::run(DNACalibDNAReader*output){ pImpl->run(static_cast<DNACalibDNAReaderImpl*>(output)); } }//namespacednac