QT命令行解析

本文探讨如何在QT环境中解析包含多个参数的命令行,例如`--usb --file=0x100000::0x200000::C:UsersminxiaoyaoDesktop est.txt::NAND::chip0 --tspid=0x1b58 --tbpid=0xdd --info=0x03::0x01::0x01010101::V0.000000000000 -o=C:UsersminxiaoyaoDesktop444.bin`。内容涉及C++编程,讲解如何处理这些参数以实现特定功能,如文件操作、设备通信等。
摘要由CSDN通过智能技术生成

解析该命令行:
–usb –file=0x100000::0x200000::C:\Users\minxiaoyao\Desktop\test.txt::NAND::chip0 –tspid=0x1b58 –tbpid=0xdd –info=0x03::0x01::0x01010101::V0.000000000000 -o=C:\Users\minxiaoyao\Desktop\444.bin

#include <QCoreApplication>
#include <QCommandLineParser>
#include <QStringList>
#include <QDebug>

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);

    //添加命令选项
    QCommandLineOption op1("usb","USB打包");
    QCommandLineOption op2("ts", "TS流打包");
    QCommandLineOption op3("file", "烧写起始地址::烧写结束地址::烧写文件::Flash类型选择::Chip片选","list");
QCommandLineOption op4("tspid", "Tspid","int");
   QCommandLineOption op5("tbpid", "Tablepid","int");
   QCommandLineOption op6("info", "厂商id::硬件版本::软件版本::IP版本","list");
   QCommandLineOption op7(QStringList()<<"o"<<&#
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值