如何将字符串分割并存入结构体中
非洲乌鸦 2012-08-01 02:34:35 读取到一系列格式如下的字符串
BaseID="AAAA" BasisName="BBBBBBBBBB" Par_id="" TypeId="3" Grade="1" SecretDegree="0" LimitType="0" LimitTime="" LimitValue="" Short_Name="CCCCCC" Check_Flag="1"
字符串中每一项由空格隔开,有什么方法能将双引号中的内容解析出来存入如下的结构体中:
typedef struct
{
String BaseID;(AAAA)
String BasisName;(BBBBBBBB)
sal_Int64 Par_id;
USHORT TypeId;(3)
USHORT Grade;(1)
USHORT SecretDegree;
USHORT LimitType;
String LimitTime;
USHORT LimitValue;
String Short_Name;
bool Check_Flag;
}CaseInfo;
typedef ::std::vector<CaseInfo> XMLCase;
最好能有源码实现