﻿<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>学习日记 &#187; json</title>
	<atom:link href="https://www.softwareace.cn/?feed=rss2&#038;tag=json" rel="self" type="application/rss+xml" />
	<link>https://www.softwareace.cn</link>
	<description>时刻想着为自己的产品多做一些对他好的事情</description>
	<lastBuildDate>Fri, 20 Mar 2026 06:58:28 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>json数据分析http网页抓取</title>
		<link>https://www.softwareace.cn/?p=327</link>
		<comments>https://www.softwareace.cn/?p=327#comments</comments>
		<pubDate>Thu, 04 Apr 2013 14:04:34 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[net work]]></category>
		<category><![CDATA[json]]></category>

		<guid isPermaLink="false">http://www.softwareace.cn/?p=327</guid>
		<description><![CDATA[主要是对一些通用功能的简单封装，包括： json数据分析类 文件访问类， htttp链接类（支持异步链接，一句 [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>主要是对一些通用功能的简单封装，包括：<br />
json数据分析类<br />
文件访问类，<br />
htttp链接类（支持异步链接，一句代码即可抓取一个网页）<br />
线程池类，<br />
任务类<br />
正则表达式类，主要是对开源的pcre的封装<br />
字符串类，嵌入正则表达式支持<br />
……<br />
源码链接地址：<br />
<a href="https://github.com/qqjack/MyLibOfMySelf" rel="nofollow">https://github.com/qqjack/MyLibOfMySelf</a><br />
欢迎修改，完善，添加新通用功能。。谢谢</p><pre class="crayon-plain-tag">int main(int argc, char* argv[])
{
	CMyAsyncHttp  asyncHttp;

//	CMyThreadPool	threadPool(true);

	CMyAsyncHttp::InitalHttp();
//	asyncHttp.SetTargetThreadPool(&amp;amp;threadPool);
	asyncHttp.SetAcceptType(&quot;*/*&quot;);
	asyncHttp.AddHttpHeader(&quot;Accept-Charset: utf-8\r\n&quot;);
	asyncHttp.AddHttpHeader(&quot;Accept-Encoding: gzip, deflate\r\n&quot;);
	asyncHttp.Get(&quot;http://www.youku.com/&quot;,&quot;&quot;);

	WaitForSingleObject(asyncHttp.m_FinishNotify,-1);
	return 0;
}</pre><p></p>
]]></content:encoded>
			<wfw:commentRss>https://www.softwareace.cn/?feed=rss2&#038;p=327</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Qt 解析 JSON 一例</title>
		<link>https://www.softwareace.cn/?p=313</link>
		<comments>https://www.softwareace.cn/?p=313#comments</comments>
		<pubDate>Thu, 04 Apr 2013 13:05:55 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[Qt Gui]]></category>
		<category><![CDATA[json]]></category>

		<guid isPermaLink="false">http://www.softwareace.cn/?p=313</guid>
		<description><![CDATA[[crayon-69fc79e2e678e124700733/] &#160;]]></description>
				<content:encoded><![CDATA[<p></p><pre class="crayon-plain-tag">QString http_response =
            "{\"key\":\"a99fdd865c2-10000\",\"oid\":1000055,\"expires
\":0000,\"secret\" :\"509c03edfdc7\",\"sign\":\"f0dd9e5226d0e77\"}";

QScriptValue sc;
QScriptEngine engine;
sc = engine.evaluate("value = " + http_response);

QScriptValueIterator it(sc);
while (it.hasNext()) {
    it.next();
    qDebug() &lt;&lt; it.name() &lt;&lt; ": " &lt;&lt; it.value().toString();
}</pre><p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>https://www.softwareace.cn/?feed=rss2&#038;p=313</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Qjson 将 QVariant 对象转为 JSON 数据</title>
		<link>https://www.softwareace.cn/?p=312</link>
		<comments>https://www.softwareace.cn/?p=312#comments</comments>
		<pubDate>Thu, 04 Apr 2013 13:03:45 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[Qt Gui]]></category>
		<category><![CDATA[json]]></category>

		<guid isPermaLink="false">http://www.softwareace.cn/?p=312</guid>
		<description><![CDATA[[crayon-69fc79e2e6974059513932/] &#160;]]></description>
				<content:encoded><![CDATA[<p></p><pre class="crayon-plain-tag">//cpp
QVariantList people;
QVariantMap bob;
bob.insert("Name", "Bob");
bob.insert("Phonenumber", 123);
QVariantMap alice;
alice.insert("Name", "Alice");
alice.insert("Phonenumber", 321);
people &lt;&lt; bob &lt;&lt; alice;
QJson::Serializer serializer;
QByteArray json = serializer.serialize(people);
qDebug() &lt;&lt; json;

//qDebug
"[ { "Name" : "Bob", "Phonenumber" : 123 },
   { "Name" : "Alice", "Phonenumber" : 321 } ]"</pre><p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>https://www.softwareace.cn/?feed=rss2&#038;p=312</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Qjson: QObject 对象序列化为 JSON 数据</title>
		<link>https://www.softwareace.cn/?p=311</link>
		<comments>https://www.softwareace.cn/?p=311#comments</comments>
		<pubDate>Thu, 04 Apr 2013 12:34:47 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[Qt Gui]]></category>
		<category><![CDATA[json]]></category>

		<guid isPermaLink="false">http://www.softwareace.cn/?p=311</guid>
		<description><![CDATA[[crayon-69fc79e2e6b44575695619/]]]></description>
				<content:encoded><![CDATA[<p></p><pre class="crayon-plain-tag">//Person.h
class Person : public QObject
{
 Q_OBJECT

 Q_PROPERTY(QString name READ name WRITE setName)
 Q_PROPERTY(int phoneNumber READ phoneNumber WRITE setPhoneNumber)
 Q_PROPERTY(Gender gender READ gender WRITE setGender)
 Q_PROPERTY(QDate dob READ dob WRITE setDob)
 Q_ENUMS(Gender)

public:
   Person(QObject* parent = 0);
   ~Person();

   QString name() const;
   void setName(const QString&amp; name);

   int phoneNumber() const;
   void setPhoneNumber(const int  phoneNumber);

   enum Gender {Male, Female};
   void setGender(Gender gender);
   Gender gender() const;

   QDate dob() const;
   void setDob(const QDate&amp; dob);

 private:
   QString m_name;
   int m_phoneNumber;
   Gender m_gender;
   QDate m_dob;
};

//.cpp
Person person;
person.setName("Flavio");
person.setPhoneNumber(123456);
person.setGender(Person::Male);
person.setDob(QDate(1982, 7, 12));

QVariantMap variant = QObjectHelper::qobject2qvariant(&amp;person);
Serializer serializer;
qDebug() &lt;&lt; serializer.serialize( variant);

//qDebug
{ "dob" : "1982-07-12",
  "gender" : 0,
  "name" : "Flavio",
  "phoneNumber" : 123456 }</pre><p></p>
]]></content:encoded>
			<wfw:commentRss>https://www.softwareace.cn/?feed=rss2&#038;p=311</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
