<?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>教程 &#8211; 编码无悔 /  Intent &amp; Focused</title>
	<atom:link href="https://www.codelast.com/tag/tutorial/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.codelast.com</link>
	<description>最优化之路</description>
	<lastBuildDate>Sat, 18 Nov 2023 15:11:46 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>[原创] Apache Pig问题：Encountered IOException. org.apache.pig.tools.parameters.ParseException: Encountered &quot;&quot;</title>
		<link>https://www.codelast.com/%e5%8e%9f%e5%88%9b-apache-pig%e9%97%ae%e9%a2%98%ef%bc%9aencountered-ioexception-org-apache-pig-tools-parameters-parseexception-encountered/</link>
					<comments>https://www.codelast.com/%e5%8e%9f%e5%88%9b-apache-pig%e9%97%ae%e9%a2%98%ef%bc%9aencountered-ioexception-org-apache-pig-tools-parameters-parseexception-encountered/#respond</comments>
		
		<dc:creator><![CDATA[learnhard]]></dc:creator>
		<pubDate>Thu, 25 Jul 2019 03:13:17 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[apache pig]]></category>
		<category><![CDATA[Encountered EOF]]></category>
		<category><![CDATA[教程]]></category>
		<guid isPermaLink="false">https://www.codelast.com/?p=10465</guid>

					<description><![CDATA[<p>查看更多Apache Pig的教程请点击<a href="https://www.codelast.com/?p=4550" rel="noopener noreferrer" target="_blank"><span style="background-color: rgb(255, 160, 122);">这里</span></a>。</p>
<p>运行Pig脚本时报错：</p>
<section class="output_wrapper" id="output_wrapper_id" style="font-size: 16px; color: rgb(62, 62, 62); line-height: 1.6; letter-spacing: 0px; font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;">
<pre style="font-size: inherit; color: inherit; line-height: inherit; margin-top: 0px; margin-bottom: 0px; padding: 0px;">
<code class="sql language-sql hljs" style="margin: 0px 2px; line-height: 18px; font-size: 14px; letter-spacing: 0px; font-family: Consolas, Inconsolata, Courier, monospace; border-radius: 0px; color: rgb(169, 183, 198); background: rgb(40, 43, 46); padding: 0.5em; overflow-wrap: normal !important; word-break: normal !important; overflow: auto !important; display: -webkit-box !important;">Error&#160;before&#160;Pig&#160;is&#160;launched
<span class="hljs-comment" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(128, 128, 128); word-wrap: inherit !important; word-break: inherit !important;">----------------------------</span>
ERROR&#160;2997:&#160;Encountered&#160;IOException.&#160;org.apache.pig.tools.parameters.ParseException:&#160;Encountered&#160;&#34;&#60;EOF&#62;&#34;&#160;at&#160;line&#160;1,&#160;column&#160;8.
Was&#160;expecting&#160;one&#160;of:
&#160;&#160;&#160;&#160;&#60;IDENTIFIER&#62;&#160;...
&#160;&#160;&#160;&#160;&#60;OTHER&#62;&#160;...
&#160;&#160;&#160;&#160;&#60;LITERAL&#62;&#160;...
&#160;&#160;&#160;&#160;&#60;SHELLCMD&#62;&#160;...
java.io.IOException:&#160;org.apache.pig.tools.parameters.ParseException:&#160;Encountered&#160;&#34;&#60;EOF&#62;&#34;&#160;at&#160;line&#160;1,&#160;column&#160;8.
Was&#160;expecting&#160;one&#160;of:
&#160;&#160;&#160;&#160;&#60;IDENTIFIER&#62;&#160;...
&#160;&#160;&#160;&#160;&#60;OTHER&#62;&#160;...
&#160;&#160;&#160;&#160;&#60;LITERAL&#62;&#160;...
&#160;&#160;&#160;&#160;&#60;SHELLCMD&#62;&#160;...

&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;at&#160;org.apache.pig.impl.PigContext.doParamSubstitution(PigContext.java:408)
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;at&#160;org.apache.pig.Main.runParamPreprocessor(Main.java:783)
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;at&#160;org.apache.pig.Main.run(Main.java:446)
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;at&#160;org.apache.pig.Main.main(Main.java:158)
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;at&#160;sun.reflect.NativeMethodAccessorImpl.invoke0(Native&#160;Method)
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;at&#160;sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;at&#160;sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;at&#160;java.lang.reflect.Method.invoke(Method.java:497)
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;at&#160;org.apache.hadoop.util.RunJar.run(RunJar.java:221)
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;at&#160;org.apache.hadoop.util.RunJar.main(RunJar.java:136)
Caused&#160;by:&#160;org.apache.pig.tools.parameters.ParseException:&#160;Encountered&#160;&#34;&#60;EOF&#62;&#34;&#160;at&#160;line&#160;1,&#160;column&#160;8.
</code></pre>
</section>
<div>
	<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
	这个问题有可能有多种原因，比如某行漏写了语句结尾的分号。这里我遇到的是另一个原因：调用该Pig脚本的shell脚本，用 -p &#34;xxx=$X&#34; 这种形式传参时，参数为空，修正参数为空的问题即可解决。<br />
	<span id="more-10465"></span><br />
	<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
	<span style="color: rgb(255, 0, 0);">➤➤</span>&#160;版权声明&#160;<span style="color: rgb(255, 0, 0);">➤➤</span>&#160;<br />
	转载需注明出处：<u><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><em><span style="color: rgb(0, 0, 255);"><strong style="font-size: 16px;"><span style="font-family: arial, helvetica, sans-serif;">codelast.com</span></strong></span></em></a></u></div>&#8230; <a href="https://www.codelast.com/%e5%8e%9f%e5%88%9b-apache-pig%e9%97%ae%e9%a2%98%ef%bc%9aencountered-ioexception-org-apache-pig-tools-parameters-parseexception-encountered/" class="read-more">Read More </a>]]></description>
										<content:encoded><![CDATA[<p>查看更多Apache Pig的教程请点击<a href="https://www.codelast.com/?p=4550" rel="noopener noreferrer" target="_blank"><span style="background-color: rgb(255, 160, 122);">这里</span></a>。</p>
<p>运行Pig脚本时报错：</p>
<section class="output_wrapper" id="output_wrapper_id" style="font-size: 16px; color: rgb(62, 62, 62); line-height: 1.6; letter-spacing: 0px; font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;">
<pre style="font-size: inherit; color: inherit; line-height: inherit; margin-top: 0px; margin-bottom: 0px; padding: 0px;">
<code class="sql language-sql hljs" style="margin: 0px 2px; line-height: 18px; font-size: 14px; letter-spacing: 0px; font-family: Consolas, Inconsolata, Courier, monospace; border-radius: 0px; color: rgb(169, 183, 198); background: rgb(40, 43, 46); padding: 0.5em; overflow-wrap: normal !important; word-break: normal !important; overflow: auto !important; display: -webkit-box !important;">Error&nbsp;before&nbsp;Pig&nbsp;is&nbsp;launched
<span class="hljs-comment" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(128, 128, 128); word-wrap: inherit !important; word-break: inherit !important;">----------------------------</span>
ERROR&nbsp;2997:&nbsp;Encountered&nbsp;IOException.&nbsp;org.apache.pig.tools.parameters.ParseException:&nbsp;Encountered&nbsp;&quot;&lt;EOF&gt;&quot;&nbsp;at&nbsp;line&nbsp;1,&nbsp;column&nbsp;8.
Was&nbsp;expecting&nbsp;one&nbsp;of:
&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDENTIFIER&gt;&nbsp;...
&nbsp;&nbsp;&nbsp;&nbsp;&lt;OTHER&gt;&nbsp;...
&nbsp;&nbsp;&nbsp;&nbsp;&lt;LITERAL&gt;&nbsp;...
&nbsp;&nbsp;&nbsp;&nbsp;&lt;SHELLCMD&gt;&nbsp;...
java.io.IOException:&nbsp;org.apache.pig.tools.parameters.ParseException:&nbsp;Encountered&nbsp;&quot;&lt;EOF&gt;&quot;&nbsp;at&nbsp;line&nbsp;1,&nbsp;column&nbsp;8.
Was&nbsp;expecting&nbsp;one&nbsp;of:
&nbsp;&nbsp;&nbsp;&nbsp;&lt;IDENTIFIER&gt;&nbsp;...
&nbsp;&nbsp;&nbsp;&nbsp;&lt;OTHER&gt;&nbsp;...
&nbsp;&nbsp;&nbsp;&nbsp;&lt;LITERAL&gt;&nbsp;...
&nbsp;&nbsp;&nbsp;&nbsp;&lt;SHELLCMD&gt;&nbsp;...

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;org.apache.pig.impl.PigContext.doParamSubstitution(PigContext.java:408)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;org.apache.pig.Main.runParamPreprocessor(Main.java:783)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;org.apache.pig.Main.run(Main.java:446)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;org.apache.pig.Main.main(Main.java:158)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;sun.reflect.NativeMethodAccessorImpl.invoke0(Native&nbsp;Method)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;java.lang.reflect.Method.invoke(Method.java:497)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;org.apache.hadoop.util.RunJar.run(RunJar.java:221)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;org.apache.hadoop.util.RunJar.main(RunJar.java:136)
Caused&nbsp;by:&nbsp;org.apache.pig.tools.parameters.ParseException:&nbsp;Encountered&nbsp;&quot;&lt;EOF&gt;&quot;&nbsp;at&nbsp;line&nbsp;1,&nbsp;column&nbsp;8.
</code></pre>
</section>
<div>
	<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
	这个问题有可能有多种原因，比如某行漏写了语句结尾的分号。这里我遇到的是另一个原因：调用该Pig脚本的shell脚本，用 -p &quot;xxx=$X&quot; 这种形式传参时，参数为空，修正参数为空的问题即可解决。<br />
	<span id="more-10465"></span><br />
	<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
	<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;版权声明&nbsp;<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;<br />
	转载需注明出处：<u><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><em><span style="color: rgb(0, 0, 255);"><strong style="font-size: 16px;"><span style="font-family: arial, helvetica, sans-serif;">codelast.com</span></strong></span></em></a></u>&nbsp;<br />
	感谢关注我的微信公众号（微信扫一扫）：</p>
<p style="border: 0px; font-size: 13px; margin: 0px 0px 9px; outline: 0px; padding: 0px; color: rgb(77, 77, 77);">
		<img decoding="async" alt="wechat qrcode of codelast" src="https://www.codelast.com/codelast_wechat_qr_code.jpg" style="width: 200px; height: 200px;" /><br />
		以及我的微信视频号：</p>
<p style="border: 0px; font-size: 13px; margin: 0px 0px 9px; outline: 0px; padding: 0px; color: rgb(77, 77, 77);">
		<img decoding="async" alt="" src="https://www.codelast.com/wechat_shipinhao_qr_code.jpg" style="text-align: center; width: 200px; height: 199px;" /></p>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codelast.com/%e5%8e%9f%e5%88%9b-apache-pig%e9%97%ae%e9%a2%98%ef%bc%9aencountered-ioexception-org-apache-pig-tools-parameters-parseexception-encountered/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[原创] 树莓派视频教程</title>
		<link>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e6%a0%91%e8%8e%93%e6%b4%be%e8%a7%86%e9%a2%91%e6%95%99%e7%a8%8b/</link>
					<comments>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e6%a0%91%e8%8e%93%e6%b4%be%e8%a7%86%e9%a2%91%e6%95%99%e7%a8%8b/#respond</comments>
		
		<dc:creator><![CDATA[learnhard]]></dc:creator>
		<pubDate>Thu, 04 Jun 2015 18:22:49 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Raspberry Pi/树莓派]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[jikexueyuan]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[教程]]></category>
		<category><![CDATA[极客学院]]></category>
		<category><![CDATA[树莓派]]></category>
		<category><![CDATA[视频教程]]></category>
		<guid isPermaLink="false">http://www.codelast.com/?p=8462</guid>

					<description><![CDATA[<p>
我为<a href="http://www.jikexueyuan.com/" target="_blank" rel="noopener noreferrer">极客学院</a>录制了一个系列的树莓派视频教程，总共有6节大课。<br />
该系列课程内容是基于树莓派Model B+型号的，而本站里我以前写过的很多树莓派文章是基于树莓派Model B型号（较老）的，因此，我录制的这些课程内容更&#8220;新&#8221;一些，适合于初学者学习。<br />
由于是商业用途的课程，所以极客学院只把每节大课的第一课时设置为可以免费观看的，并且由于有协议约束，我也不能把教学视频发布到其他任何一个网站上，在这里我要向大家说抱歉，希望大家能支持极客学院。<br />
但是，作为一个知识共享的拥护者，我希望每个人都能得到尽可能多的知识，因此，如果有时间的话，我会在本站写一些类似的技术文章出来。并且，本系列教程中的所有代码，都上传到了Github，你可以到<a href="https://github.com/codelast/raspberry-pi" target="_blank" rel="noopener noreferrer"><span style="background-color:#ffa07a;">这里</span></a>下载。<br />
<span id="more-8462"></span><br />
<span style="background-color:#00ff00;">（1）</span><a href="http://www.jikexueyuan.com/course/714.html" target="_blank" rel="noopener noreferrer">走进树莓派的世界</a><br />
1.1 树莓派基础介绍<br />
1.2 树莓派型号指南<br />
1.3 介绍进行树莓派开发需要的硬件<br />
1.4 树莓派工作场景：图形 vs 命令行<br />
1.5 在树莓派上选择&#38;安装系统<br />
1.6 配置树莓派<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255);">http://www.codelast.com/</span></a><br />
<span style="background-color:#00ff00;">（2）</span><a href="http://www.jikexueyuan.com/course/796.html" target="_blank" rel="noopener noreferrer">树莓派的摄像头应用</a><br />
2.1&#160;使用树莓派控制摄像头采集图像<br />
2.2&#160;使用树莓派控制摄像头采集视频及运动检测<br />
2.3&#160;使用树莓派进行人脸识别<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255);">http://www.codelast.com/</span></a><br />
<span style="background-color:#00ff00;">（3）</span><a href="http://www.jikexueyuan.com/course/1345.html" target="_blank" rel="noopener noreferrer">树莓派的 GPIO 基础</a><br />
3.1&#160;树莓派的 GPIO 接口介绍<br />
3.2&#160;控制 GPIO 的钥匙：WiringPi 开发库<br />
3.3&#160;Fritzing 辅助设计工具基础</p>
<p><span style="background-color: rgb(0, 255, 0);">（4）</span><a href="http://www.jikexueyuan.com/course/1573.html" target="_blank" rel="noopener noreferrer">树莓派的GPIO应用（一）</a><br />
4.1&#160;GPIO 接口编程(1)：LED 闪烁( OUTPUT )<br />
4.2&#160;GPIO 接口编程(2)：按钮控制 LED ( INPUT ) &#8212;&#8212;包括Pooling及Interrupt实现，Software Switch Debouncing实现<br />
4.3&#160;GPIO 接口编程(3)：LED 呼吸灯&#38;驱动压电元件( PWM )</p>
<p><span style="background-color: rgb(0, 255, 0);">（5）</span><a href="http://www.jikexueyuan.com/course/2033.html" target="_blank" rel="noopener noreferrer">树莓派的GPIO应用（二）</a><br />
5.1&#160;人体接近感应灯<br />
5.2&#160;控制步进电机<br />
5.3&#160;驱动液晶屏&#8212;&#8212;包括多GPIO口及I2C总线驱动LCD1602实现</p>
<p><span style="background-color:#00ff00;">（6）</span><a href="http://www.jikexueyuan.com/course/2791.html" target="_blank" rel="noopener noreferrer">树莓派项目实践（一）&#8212;&#8212;可用 web 控制的人体感应小夜灯</a><br />
6.1&#160;需求分析<br />
6.2&#160;人体接近感应功能的实现<br />
6.3&#160;让树莓派系统正确走时<br />
6.4&#160;前后端程序实现</p>
<p></p>
<p style="font-size: 16px; margin: 5px 0px; clear: both; font-family: sans-serif;">
	<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a>&#8230; <a href="https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e6%a0%91%e8%8e%93%e6%b4%be%e8%a7%86%e9%a2%91%e6%95%99%e7%a8%8b/" class="read-more">Read More </a></p>]]></description>
										<content:encoded><![CDATA[<p>
我为<a href="http://www.jikexueyuan.com/" target="_blank" rel="noopener noreferrer">极客学院</a>录制了一个系列的树莓派视频教程，总共有6节大课。<br />
该系列课程内容是基于树莓派Model B+型号的，而本站里我以前写过的很多树莓派文章是基于树莓派Model B型号（较老）的，因此，我录制的这些课程内容更&ldquo;新&rdquo;一些，适合于初学者学习。<br />
由于是商业用途的课程，所以极客学院只把每节大课的第一课时设置为可以免费观看的，并且由于有协议约束，我也不能把教学视频发布到其他任何一个网站上，在这里我要向大家说抱歉，希望大家能支持极客学院。<br />
但是，作为一个知识共享的拥护者，我希望每个人都能得到尽可能多的知识，因此，如果有时间的话，我会在本站写一些类似的技术文章出来。并且，本系列教程中的所有代码，都上传到了Github，你可以到<a href="https://github.com/codelast/raspberry-pi" target="_blank" rel="noopener noreferrer"><span style="background-color:#ffa07a;">这里</span></a>下载。<br />
<span id="more-8462"></span><br />
<span style="background-color:#00ff00;">（1）</span><a href="http://www.jikexueyuan.com/course/714.html" target="_blank" rel="noopener noreferrer">走进树莓派的世界</a><br />
1.1 树莓派基础介绍<br />
1.2 树莓派型号指南<br />
1.3 介绍进行树莓派开发需要的硬件<br />
1.4 树莓派工作场景：图形 vs 命令行<br />
1.5 在树莓派上选择&amp;安装系统<br />
1.6 配置树莓派<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255);">http://www.codelast.com/</span></a><br />
<span style="background-color:#00ff00;">（2）</span><a href="http://www.jikexueyuan.com/course/796.html" target="_blank" rel="noopener noreferrer">树莓派的摄像头应用</a><br />
2.1&nbsp;使用树莓派控制摄像头采集图像<br />
2.2&nbsp;使用树莓派控制摄像头采集视频及运动检测<br />
2.3&nbsp;使用树莓派进行人脸识别<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255);">http://www.codelast.com/</span></a><br />
<span style="background-color:#00ff00;">（3）</span><a href="http://www.jikexueyuan.com/course/1345.html" target="_blank" rel="noopener noreferrer">树莓派的 GPIO 基础</a><br />
3.1&nbsp;树莓派的 GPIO 接口介绍<br />
3.2&nbsp;控制 GPIO 的钥匙：WiringPi 开发库<br />
3.3&nbsp;Fritzing 辅助设计工具基础</p>
<p><span style="background-color: rgb(0, 255, 0);">（4）</span><a href="http://www.jikexueyuan.com/course/1573.html" target="_blank" rel="noopener noreferrer">树莓派的GPIO应用（一）</a><br />
4.1&nbsp;GPIO 接口编程(1)：LED 闪烁( OUTPUT )<br />
4.2&nbsp;GPIO 接口编程(2)：按钮控制 LED ( INPUT ) &mdash;&mdash;包括Pooling及Interrupt实现，Software Switch Debouncing实现<br />
4.3&nbsp;GPIO 接口编程(3)：LED 呼吸灯&amp;驱动压电元件( PWM )</p>
<p><span style="background-color: rgb(0, 255, 0);">（5）</span><a href="http://www.jikexueyuan.com/course/2033.html" target="_blank" rel="noopener noreferrer">树莓派的GPIO应用（二）</a><br />
5.1&nbsp;人体接近感应灯<br />
5.2&nbsp;控制步进电机<br />
5.3&nbsp;驱动液晶屏&mdash;&mdash;包括多GPIO口及I2C总线驱动LCD1602实现</p>
<p><span style="background-color:#00ff00;">（6）</span><a href="http://www.jikexueyuan.com/course/2791.html" target="_blank" rel="noopener noreferrer">树莓派项目实践（一）&mdash;&mdash;可用 web 控制的人体感应小夜灯</a><br />
6.1&nbsp;需求分析<br />
6.2&nbsp;人体接近感应功能的实现<br />
6.3&nbsp;让树莓派系统正确走时<br />
6.4&nbsp;前后端程序实现</p>
<p></p>
<p style="font-size: 16px; margin: 5px 0px; clear: both; font-family: sans-serif;">
	<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
	<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;版权声明&nbsp;<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;<br />
	转载需注明出处：<u><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><em><span style="color: rgb(0, 0, 255);"><strong><span style="font-family: arial, helvetica, sans-serif;">codelast.com</span></strong></span></em></a></u>&nbsp;<br />
	感谢关注我的微信公众号（微信扫一扫）：</p>
<p style="border: 0px; font-size: 13px; margin: 0px 0px 9px; outline: 0px; padding: 0px; color: rgb(77, 77, 77);">
	<img decoding="async" alt="wechat qrcode of codelast" src="https://www.codelast.com/codelast_wechat_qr_code.jpg" style="width: 200px; height: 200px;" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e6%a0%91%e8%8e%93%e6%b4%be%e8%a7%86%e9%a2%91%e6%95%99%e7%a8%8b/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[原创] Google Protocol Buffers中文教程</title>
		<link>https://www.codelast.com/google-protocol-buffers%e4%b8%ad%e6%96%87%e6%95%99%e7%a8%8b/</link>
					<comments>https://www.codelast.com/google-protocol-buffers%e4%b8%ad%e6%96%87%e6%95%99%e7%a8%8b/#comments</comments>
		
		<dc:creator><![CDATA[learnhard]]></dc:creator>
		<pubDate>Sun, 27 Oct 2013 08:43:29 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[综合]]></category>
		<category><![CDATA[Avro]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[MessagePack]]></category>
		<category><![CDATA[Protocol Buffer]]></category>
		<category><![CDATA[Protocol Buffers]]></category>
		<category><![CDATA[Thrift]]></category>
		<category><![CDATA[中文]]></category>
		<category><![CDATA[使用]]></category>
		<category><![CDATA[教程]]></category>
		<guid isPermaLink="false">http://www.codelast.com/?p=8</guid>

					<description><![CDATA[<p>
	注：前面这些是本人的翻译，可能不准确，可能有错误，但是基本上可以理解，希望能对大家有所帮助。</p>
<div>
	<a href="http://www.codelast.com/?p=280" rel="noopener noreferrer" target="_blank">Protocol Buffer Basics: C++中文翻译（Google Protocol Buffers中文教程）</a></div>
<div>
	&#160;</div>
<div>
	<a href="http://www.codelast.com/?p=299" rel="noopener noreferrer" target="_blank">Language Guide中文翻译（Google Protocol Buffers中文教程）</a></div>
<div>
	&#160;</div>
<div>
	<a href="http://www.codelast.com/?p=305" rel="noopener noreferrer" target="_blank">Style Guide中文翻译（Google Protocol Buffers中文教程）</a></div>
<div>
	&#160;</div>
<div>
	<a href="http://www.codelast.com/?p=316" rel="noopener noreferrer" target="_blank">Techniques 中文翻译（Google Protocol Buffers中文教程）</a>
<div>
<span id="more-8"></span>		<br />
		下面是我使用Google Protocol Buffers的一些总结：
<p>		<a href="http://www.codelast.com/?p=8519" rel="noopener noreferrer" target="_blank">Protocol Buffers的Emacs语法高亮</a></p></div>
</div>
<p>
	&#160;</p>
<p style="border: 0px; font-size: 13px; margin: 0px 0px 9px; outline: 0px; padding: 0px; color: rgb(77, 77, 77);">
	<br />
	<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
	<span style="color: rgb(255, 0, 0);">➤➤</span>&#160;版权声明&#160;<span style="color: rgb(255, 0, 0);">➤➤</span>&#160;<br />
	转载需注明出处：<u><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><em><span style="color: rgb(0, 0, 255);"><strong style="font-size: 16px;"><span style="font-family: arial, helvetica, sans-serif;">codelast.com</span></strong></span></em></a></u>&#160;<br />
	感谢关注我的微信公众号（微信扫一扫）：</p>
<p style="border: 0px; font-size: 13px; margin: 0px 0px 9px; outline: 0px; padding: 0px; color: rgb(77, 77, 77);">
	<img decoding="async" alt="wechat qrcode of codelast" src="https://www.codelast.com/codelast_wechat_qr_code.jpg" style="width: 200px; height: 200px;" />&#8230; <a href="https://www.codelast.com/google-protocol-buffers%e4%b8%ad%e6%96%87%e6%95%99%e7%a8%8b/" class="read-more">Read More </a></p>]]></description>
										<content:encoded><![CDATA[<p>
	注：前面这些是本人的翻译，可能不准确，可能有错误，但是基本上可以理解，希望能对大家有所帮助。</p>
<div>
	<a href="http://www.codelast.com/?p=280" rel="noopener noreferrer" target="_blank">Protocol Buffer Basics: C++中文翻译（Google Protocol Buffers中文教程）</a></div>
<div>
	&nbsp;</div>
<div>
	<a href="http://www.codelast.com/?p=299" rel="noopener noreferrer" target="_blank">Language Guide中文翻译（Google Protocol Buffers中文教程）</a></div>
<div>
	&nbsp;</div>
<div>
	<a href="http://www.codelast.com/?p=305" rel="noopener noreferrer" target="_blank">Style Guide中文翻译（Google Protocol Buffers中文教程）</a></div>
<div>
	&nbsp;</div>
<div>
	<a href="http://www.codelast.com/?p=316" rel="noopener noreferrer" target="_blank">Techniques 中文翻译（Google Protocol Buffers中文教程）</a></p>
<div>
<span id="more-8"></span>		<br />
		下面是我使用Google Protocol Buffers的一些总结：</p>
<p>		<a href="http://www.codelast.com/?p=8519" rel="noopener noreferrer" target="_blank">Protocol Buffers的Emacs语法高亮</a></div>
</div>
<p>
	&nbsp;</p>
<p style="border: 0px; font-size: 13px; margin: 0px 0px 9px; outline: 0px; padding: 0px; color: rgb(77, 77, 77);">
	<br />
	<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
	<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;版权声明&nbsp;<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;<br />
	转载需注明出处：<u><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><em><span style="color: rgb(0, 0, 255);"><strong style="font-size: 16px;"><span style="font-family: arial, helvetica, sans-serif;">codelast.com</span></strong></span></em></a></u>&nbsp;<br />
	感谢关注我的微信公众号（微信扫一扫）：</p>
<p style="border: 0px; font-size: 13px; margin: 0px 0px 9px; outline: 0px; padding: 0px; color: rgb(77, 77, 77);">
	<img decoding="async" alt="wechat qrcode of codelast" src="https://www.codelast.com/codelast_wechat_qr_code.jpg" style="width: 200px; height: 200px;" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codelast.com/google-protocol-buffers%e4%b8%ad%e6%96%87%e6%95%99%e7%a8%8b/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
			</item>
		<item>
		<title>[原创]在Raspberry Pi(树莓派)上用OpenCV来操纵摄像头拍照/Use OpenCV on Raspberry Pi to Controll a Webcam to Take Photos</title>
		<link>https://www.codelast.com/%e5%8e%9f%e5%88%9b%e5%9c%a8raspberry-pi%e4%b8%8a%e7%94%a8opencv%e6%9d%a5%e6%93%8d%e7%ba%b5%e6%91%84%e5%83%8f%e5%a4%b4%e6%8b%8d%e7%85%a7use-opencv-on-raspberry-pi-to-controll-a-webcam-to-take-photos/</link>
					<comments>https://www.codelast.com/%e5%8e%9f%e5%88%9b%e5%9c%a8raspberry-pi%e4%b8%8a%e7%94%a8opencv%e6%9d%a5%e6%93%8d%e7%ba%b5%e6%91%84%e5%83%8f%e5%a4%b4%e6%8b%8d%e7%85%a7use-opencv-on-raspberry-pi-to-controll-a-webcam-to-take-photos/#comments</comments>
		
		<dc:creator><![CDATA[learnhard]]></dc:creator>
		<pubDate>Thu, 18 Oct 2012 07:46:00 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Raspberry Pi/树莓派]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[Arch Linux ARM]]></category>
		<category><![CDATA[camera]]></category>
		<category><![CDATA[OpenCV]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[webcam]]></category>
		<category><![CDATA[拍照]]></category>
		<category><![CDATA[摄像头]]></category>
		<category><![CDATA[教程]]></category>
		<guid isPermaLink="false">http://www.codelast.com/?p=5014</guid>

					<description><![CDATA[<p>
<span style="background-color:#00ff00;">For non-Chinese readers:</span><br />
<span style="color:#0000ff;">I&#39;m a software engineer in Shanghai, China. Since I bought a Raspberry Pi, I spent some spare time on it and I&#39;m glad to share something with Pi users all over the world, so this article has two languages: Chinese &#38; English, and I try to translate the Chinese to English as&#160;accurately as possible, but, there might be some translation mistakes, so if you don&#39;t know what I mean in the article, just leave a comment, and I&#39;ll reply when I get an answer.</span>&#8230; <a href="https://www.codelast.com/%e5%8e%9f%e5%88%9b%e5%9c%a8raspberry-pi%e4%b8%8a%e7%94%a8opencv%e6%9d%a5%e6%93%8d%e7%ba%b5%e6%91%84%e5%83%8f%e5%a4%b4%e6%8b%8d%e7%85%a7use-opencv-on-raspberry-pi-to-controll-a-webcam-to-take-photos/" class="read-more">Read More </a></p>]]></description>
										<content:encoded><![CDATA[<p>
<span style="background-color:#00ff00;">For non-Chinese readers:</span><br />
<span style="color:#0000ff;">I&#39;m a software engineer in Shanghai, China. Since I bought a Raspberry Pi, I spent some spare time on it and I&#39;m glad to share something with Pi users all over the world, so this article has two languages: Chinese &amp; English, and I try to translate the Chinese to English as&nbsp;accurately as possible, but, there might be some translation mistakes, so if you don&#39;t know what I mean in the article, just leave a comment, and I&#39;ll reply when I get an answer. Also welcome to contact me via <a href="http://www.codelast.com/?page_id=2" target="_blank" rel="noopener noreferrer">Email</a>.</span></p>
<p><a href="http://www.raspberrypi.org/" target="_blank" rel="noopener noreferrer">Raspberry Pi</a>是什么？简单地说，它就是一个基于ARM CPU的、信用卡那么大的迷你计算机。<br />
<span style="color:#0000ff;">In short, Pi is an ARM-based mini computer which has a credit card size.</span></p>
<p>本文主要内容：<br />
在Raspberry Pi上，通过调用OpenCV库，自己写一个简单的C程序来控制摄像头拍照，并保存图片。<br />
在阅读本文之前，请确保你已经阅读过我的另一篇<a href="http://www.codelast.com/?p=4945" target="_blank" rel="noopener noreferrer">配置Pi的文章</a>，因为本文是在它的基础上进行的。<br />
<span style="color:#0000ff;">The main content of this article:<br />
Write a simple C program by invoking the OpenCV library on Raspberry Pi to control a webcam to take photos &amp; save them.<br />
Before reading this article, please make sure that you&#39;ve read my another article about <a href="http://www.codelast.com/?p=4945" target="_blank" rel="noopener noreferrer"><span style="background-color:#ffa07a;">Pi configuration</span></a>, because this article is based on that.</span><br />
<span id="more-5014"></span></p>
<div style="text-align: center; ">
	<span style="background-color: rgb(0, 255, 0); "><img decoding="async" alt="my running Raspberry Pi" src="https://www.codelast.com/wp-content/uploads/2012/10/my_running_raspberry_pi.jpg" style="width: 400px; height: 538px; " /></span></div>
<div style="text-align: center; ">
	<span style="color:#a52a2a;">图：我的Pi正在运行中 / my running Raspberry Pi</span></div>
<p>
<span style="background-color: rgb(0, 255, 0); ">【1】</span>安装OpenCV <span style="color:#ff0000;">/</span> <span style="color:#0000ff;">Install OpenCV</span><br />
命令：<br />
<span style="color:#0000ff;">Command:</span></p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;" style="width: 729px; ">
pacman -S opencv opencv-samples
</pre>
<p>上面的命令连OpenCV的sample一起装上了，这样我们在安装好之后就可以编译几个sample来测试。<br />
<span style="color:#0000ff;">This command will install the samples of OpenCV, too. So we can compile &amp; run several samples to have a test after the installation.</span></p>
<p><span style="background-color: rgb(0, 255, 0); ">【2】</span>带动摄像头 <span style="color:#ff0000;">/ </span><span style="color:#0000ff;">Drive the webcam</span><br />
在驱动已经可用的情况下，把一个USB摄像头接在USB口上也不一定能让它工作，因为Pi的USB口的电流供应可能不足。请看<a href="http://eduardofv.com/read_post/189-DIY-Powered-USB-Cable-for-Raspberry-Pi" target="_blank" rel="noopener noreferrer">这个链接</a>的玩家自制的一根增强供电的USB线，如果你想简单安全，那么你可以把摄像头接在一个有外部供电的USB HUB上，再把Pi的USB接到USB HUB上，这样摄像头的供电就充足了。<br />
<span style="color:#0000ff;">Plug the USB webcam into the USB interface of Pi might not able to make it work, even the driver has been available, because the current provided by Pi&#39;s USB interface may not be&nbsp;sufficient to drive a camera. You can learn to DIY a current-enhancement USB cable via </span><a href="http://eduardofv.com/read_post/189-DIY-Powered-USB-Cable-for-Raspberry-Pi" target="_blank" rel="noopener noreferrer"><span style="color:#0000ff;"><span style="background-color:#ffa07a;">this link</span></span></a><span style="color:#0000ff;">, but the easier way may be buying a powered USB HUB and use it to connect the webcam &amp; Pi.</span></p>
<p><span style="background-color: rgb(0, 255, 0); ">【3】</span>让opencv的sample跑起来 <span style="color:#ff0000;">/</span> <span style="color:#0000ff;">Run a sample of OpenCV</span><br />
为了验证在Pi上安装的OpenCV是可用的，所以至少要让一个sample可以跑起来。<br />
为了不把安装目录弄得一团乱，首先把安装好的OpenCV的sample目录拷贝到其他地方：<br />
<span style="color:#0000ff;">To make sure that the installed OpenCV related packages are &quot;correct&quot;, I decided to run at least one of the OpenCV samples.<br />
Copy the installed OpenCV sample directory to other place for the sake of not messing up the installation directory:</span></p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;" style="width: 729px; ">
mkdir /root/opencv
cp -r /usr/share/OpenCV/samples/ /root/opencv/
</pre>
<p>我们看到里面有&ldquo;c&rdquo;，&ldquo;cpp&rdquo;和&ldquo;gpu&rdquo;三种sample，选最简单的，我们进入&ldquo;c&rdquo;，先为所有文件加上写权限：<br />
<span style="color:#0000ff;">There are 3 kinds of samples in it, &quot;c&quot;, &quot;cpp&quot; &amp; &quot;gpu&quot;, so I choose the&nbsp;simplest - &quot;c&quot;, and enter the &quot;c&quot; directory, add write&nbsp;permission to all files:</span></p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;" style="width: 729px; ">
chmod +w *
</pre>
<p>然后我们看到&ldquo;c&rdquo;目录里有编译脚本&nbsp;<span style="color:#b22222;">build_all.sh</span>，执行它，看到出了一堆相似的错误，没有一个程序可以成功编译，例如以下错误：<br />
<span style="color:#0000ff;">Execute the </span><span style="color:#b22222;">build_all.sh</span><span style="color:#0000ff;"> script to compile an sample, then I got lots of similar errors, e.g. :</span></p>
<blockquote>
<div>
		[root@alarmpi c]# ./build_all.sh contours.c&nbsp;</div>
<div>
		&nbsp;compiling contours</div>
<div>
		&nbsp;/usr/bin/ld: /tmp/cch4zRSn.o: undefined reference to symbol &#39;lrint@@GLIBC_2.4&#39;</div>
<div>
		&nbsp;/usr/bin/ld: note: &#39;lrint@@GLIBC_2.4&#39; is defined in DSO /usr/lib/libm.so.6 so try adding it to the linker command line</div>
<div>
		&nbsp;/usr/lib/libm.so.6: could not read symbols: Invalid operation</div>
<div>
		&nbsp;collect2: error: ld returned 1 exit status</div>
</blockquote>
<div>
	由 libm 可见，这是因为数学库没有被包含在编译命令中，于是我们编译&nbsp;<span style="color:#b22222;">build_all.sh</span>，为所有编译命令添加上&nbsp;<span style="color: rgb(255, 0, 0); ">-lm</span>&nbsp;编译参数：<br />
	<span style="color:#0000ff;">The &quot;libm&quot; told me that the math library was not included in the&nbsp;compiling command, so I edited&nbsp;</span><span style="color:#b22222;">build_all.sh</span><span style="color:#0000ff;">&nbsp;and add </span><span style="color:#b22222;">-lm</span><span style="color:#0000ff;"> to all compiling command:&nbsp;</span></div>
<div>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;" style="width: 729px; ">
#!/bin/sh                           

if [ $# -gt 0 ] ; then
        base=`basename $1 .c`
        echo &quot;compiling $base&quot;
        gcc -ggdb `pkg-config opencv --cflags --libs` $base.c -o $base -lm
else
        for i in *.c; do
            echo &quot;compiling $i&quot;
            gcc -ggdb `pkg-config --cflags opencv` -o `basename $i .c` $i `pkg-config --libs opencv` -lm;
        done
        for i in *.cpp; do
            echo &quot;compiling $i&quot;
            g++ -ggdb `pkg-config --cflags opencv` -o `basename $i .cpp` $i `pkg-config --libs opencv` -lm;
        done
fi
</pre>
</div>
<p><span style="color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a><br />
还忘了说一句，由于上面的脚本在编译时使用了pkg-config，所以在编译前，我们还需要先安装 pkg-config：<br />
<span style="color:#0000ff;">Sorry, I forget to mention that because of using pkg-config, we need to install pkg-config before compiling the sample:</span></p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;" style="width: 729px; ">
pacman -S pkg-config
</pre>
<p>然后再编译，成功。<br />
<span style="color:#0000ff;">Then the compiling will succeed.</span><br />
那么下面，我们再接着尝试把编译出的sample运行起来：<br />
<span style="color:#0000ff;">Then run the executable program we just compiled:</span></p>
<pre class="brush:plain;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;" style="width: 729px; ">
[root@alarmpi c]# ./contours 

This program creates an image to demonstrate the use of the &quot;c&quot; contour
functions: cvFindContours() and cvApproxPoly() along with the storage
functions cvCreateMemStorage() and cvDrawContours().
It also shows the use of a trackbar to control contour retrieval.
 
Usage :
./contours
 
(image:460): Gtk-WARNING **: cannot open display:
</pre>
<p>很明显，运行不起来。<br />
看样子是跟gtk相关，并且我在网上搜到这跟X server什么的可能有关系，于是安装gtk和X server：<br />
<span style="color: rgb(0, 0, 255); ">It failed,&nbsp;</span><span style="color:#0000ff;">unfortunately</span><span style="color: rgb(0, 0, 255); ">.</span><br />
<span style="color:#0000ff;">And Google told me that the error is related to X server, too, so I installed gtk &amp; X server:</span></p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
pacman -S gtk xorg-server
</pre>
<p>再修改配置文件&nbsp;/etc/ssh/sshd_config ：<br />
<span style="color:#0000ff;">Modify the config file /etc/ssh/sshd_config :</span></p>
<pre class="brush:plain;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;" style="width: 729px; ">
#AllowTcpForwarding yes
AllowTcpForwarding yes
#GatewayPorts no
#X11Forwarding no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
X11UseLocalhost yes
</pre>
<p>注意，没有注释的那三行是我添加的。<br />
<span style="color:#0000ff;">Note that the 3&nbsp;uncommented lines are added by me.</span><br />
<span style="color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a><br />
重启Pi的系统，运行X server：<br />
<span style="color:#0000ff;">Reboot Pi &amp; run X server:</span></p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;" style="width: 729px; ">
X
</pre>
<p>没错，命令就是这么简单。然后又出错了：<br />
<span style="color:#0000ff;">Yes, the command is just so simple, but it failed to start:</span></p>
<blockquote>
<div>
		[root@alarmpi c]# X &nbsp; &nbsp; &nbsp;&nbsp;</div>
<div>
		&nbsp;</div>
<div>
		&nbsp;X.Org X Server 1.13.0</div>
<div>
		&nbsp;Release Date: 2012-09-05</div>
<div>
		&nbsp;X Protocol Version 11, Revision 0</div>
<div>
		&nbsp;Build Operating System: Linux 3.0.15-1-ARCH+ armv6l&nbsp;</div>
<div>
		&nbsp;Current Operating System: Linux alarmpi 3.2.27-11-ARCH+ #1 PREEMPT Sat Oct 13 22:46:16 UTC 2012 armv6l</div>
<div>
		&nbsp;Kernel command line: dma.dmachans=0x7f35 bcm2708_fb.fbwidth=1920 bcm2708_fb.fbheight=1080 bcm2708.boardrev=0x3 bcm2708.serial=0x398ca41f smsc95xx.macaddr=B8:27:EB:8C:A4:1F vc_mem.mem_base=0xc000000 vc_mem.mem_size=0x10000000 &nbsp;sdhci-bcm2708.enable_llm=1 sdhci-bcm2708.sync_after_dma=0 smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 loglevel=2 root=/dev/mmcblk0p2 init=/bin/systemd rootfstype=ext4 rootwait</div>
<div>
		&nbsp;Build Date: 14 October 2012 &nbsp;10:05:22PM</div>
<div>
		&nbsp;&nbsp;</div>
<div>
		&nbsp;Current version of pixman: 0.26.2</div>
<div>
		&nbsp;<span class="Apple-tab-span" style="white-space: pre; "> </span>Before reporting problems, check http://wiki.x.org</div>
<div>
		&nbsp;<span class="Apple-tab-span" style="white-space: pre; "> </span>to make sure that you have the latest version.</div>
<div>
		&nbsp;Markers: (--) probed, (**) from config file, (==) default setting,</div>
<div>
		&nbsp;<span class="Apple-tab-span" style="white-space: pre; "> </span>(++) from command line, (!!) notice, (II) informational,</div>
<div>
		&nbsp;<span class="Apple-tab-span" style="white-space: pre; "> </span>(WW) warning, (EE) error, (NI) not implemented, (??) unknown.</div>
<div>
		&nbsp;(==) Log file: &quot;/var/log/Xorg.0.log&quot;, Time: Mon Oct 15 14:30:03 2012</div>
<div>
		&nbsp;(==) Using config directory: &quot;/etc/X11/xorg.conf.d&quot;</div>
<div>
		&nbsp;Initializing built-in extension Generic Event Extension</div>
<div>
		&nbsp;Initializing built-in extension SHAPE</div>
<div>
		&nbsp;Initializing built-in extension MIT-SHM</div>
<div>
		&nbsp;Initializing built-in extension XInputExtension</div>
<div>
		&nbsp;Initializing built-in extension XTEST</div>
<div>
		&nbsp;Initializing built-in extension BIG-REQUESTS</div>
<div>
		&nbsp;Initializing built-in extension SYNC</div>
<div>
		&nbsp;Initializing built-in extension XKEYBOARD</div>
<div>
		&nbsp;Initializing built-in extension XC-MISC</div>
<div>
		&nbsp;Initializing built-in extension SECURITY</div>
<div>
		&nbsp;Initializing built-in extension XINERAMA</div>
<div>
		&nbsp;Initializing built-in extension XFIXES</div>
<div>
		&nbsp;Initializing built-in extension RENDER</div>
<div>
		&nbsp;Initializing built-in extension RANDR</div>
<div>
		&nbsp;Initializing built-in extension COMPOSITE</div>
<div>
		&nbsp;Initializing built-in extension DAMAGE</div>
<div>
		&nbsp;Initializing built-in extension MIT-SCREEN-SAVER</div>
<div>
		&nbsp;Initializing built-in extension DOUBLE-BUFFER</div>
<div>
		&nbsp;Initializing built-in extension RECORD</div>
<div>
		&nbsp;Initializing built-in extension DPMS</div>
<div>
		&nbsp;Initializing built-in extension X-Resource</div>
<div>
		&nbsp;Initializing built-in extension XVideo</div>
<div>
		&nbsp;Initializing built-in extension XVideo-MotionCompensation</div>
<div>
		&nbsp;Initializing built-in extension XFree86-VidModeExtension</div>
<div>
		&nbsp;Initializing built-in extension XFree86-DGA</div>
<div>
		&nbsp;Initializing built-in extension XFree86-DRI</div>
<div>
		&nbsp;Initializing built-in extension DRI2</div>
<div>
		&nbsp;Loading extension GLX</div>
<div>
		&nbsp;</div>
<div>
		&nbsp;Fatal server error:</div>
<div>
		&nbsp;no screens found</div>
<div>
		&nbsp;(EE)&nbsp;</div>
<div>
		&nbsp;Please consult the The X.Org Foundation support&nbsp;</div>
<div>
		&nbsp;<span class="Apple-tab-span" style="white-space: pre; "> </span>&nbsp;at http://wiki.x.org</div>
<div>
		&nbsp; for help.&nbsp;</div>
<div>
		&nbsp;(EE) Please also check the log file at &quot;/var/log/Xorg.0.log&quot; for additional information.</div>
<div>
		&nbsp;(EE)&nbsp;</div>
<div>
		&nbsp;Server terminated with error (1). Closing log file.</div>
</blockquote>
<p>既然它让我看日志文件&nbsp;/var/log/Xorg.0.log，那我就看。在日志文件的最后，发现提示找不到 fbdev 模块/库，于是翻遍Google，找到一个答案：应该安装&nbsp;xf86-video-fbdev 包：<br />
<span style="color:#0000ff;">Since it told me to check log file&nbsp;/var/log/Xorg.0.log, then I did. At the last few lines of the log file, I found an error message which indicated a fbdev module/lib missing, so I ask Google again for a while, and I realized that I should install package&nbsp;xf86-video-fbdev:</span></p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;" style="width: 729px; ">
pacman -S xf86-video-fbdev
</pre>
<p><span style="color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a><br />
再用&ldquo;X&rdquo;命令启动X server，成功了：<br />
<span style="color:#0000ff;">Then run &quot;X&quot; again, it succeeded:</span></p>
<blockquote>
<div>
		[root@alarmpi ~]# X</div>
<div>
		&nbsp;</div>
<div>
		&nbsp;X.Org X Server 1.13.0</div>
<div>
		&nbsp;Release Date: 2012-09-05</div>
<div>
		&nbsp;X Protocol Version 11, Revision 0</div>
<div>
		&nbsp;Build Operating System: Linux 3.0.15-1-ARCH+ armv6l&nbsp;</div>
<div>
		&nbsp;Current Operating System: Linux alarmpi 3.2.27-11-ARCH+ #1 PREEMPT Sat Oct 13 22:46:16 UTC 2012 armv6l</div>
<div>
		&nbsp;Kernel command line: dma.dmachans=0x7f35 bcm2708_fb.fbwidth=1920 bcm2708_fb.fbheight=1080 bcm2708.boardrev=0x3 bcm2708.serial=0x398ca41f smsc95xx.macaddr=B8:27:EB:8C:A4:1F vc_mem.mem_base=0xc000000 vc_mem.mem_size=0x10000000 &nbsp;sdhci-bcm2708.enable_llm=1 sdhci-bcm2708.sync_after_dma=0 smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 loglevel=2 root=/dev/mmcblk0p2 init=/bin/systemd rootfstype=ext4 rootwait</div>
<div>
		&nbsp;Build Date: 14 October 2012 &nbsp;10:05:22PM</div>
<div>
		&nbsp;&nbsp;</div>
<div>
		&nbsp;Current version of pixman: 0.26.2</div>
<div>
		&nbsp;<span class="Apple-tab-span" style="white-space: pre; "> </span>Before reporting problems, check http://wiki.x.org</div>
<div>
		&nbsp;<span class="Apple-tab-span" style="white-space: pre; "> </span>to make sure that you have the latest version.</div>
<div>
		&nbsp;Markers: (--) probed, (**) from config file, (==) default setting,</div>
<div>
		&nbsp;<span class="Apple-tab-span" style="white-space: pre; "> </span>(++) from command line, (!!) notice, (II) informational,</div>
<div>
		&nbsp;<span class="Apple-tab-span" style="white-space: pre; "> </span>(WW) warning, (EE) error, (NI) not implemented, (??) unknown.</div>
<div>
		&nbsp;(==) Log file: &quot;/var/log/Xorg.0.log&quot;, Time: Mon Oct 15 14:32:34 2012</div>
<div>
		&nbsp;(==) Using config directory: &quot;/etc/X11/xorg.conf.d&quot;</div>
<div>
		&nbsp;Initializing built-in extension Generic Event Extension</div>
<div>
		&nbsp;Initializing built-in extension SHAPE</div>
<div>
		&nbsp;Initializing built-in extension MIT-SHM</div>
<div>
		&nbsp;Initializing built-in extension XInputExtension</div>
<div>
		&nbsp;Initializing built-in extension XTEST</div>
<div>
		&nbsp;Initializing built-in extension BIG-REQUESTS</div>
<div>
		&nbsp;Initializing built-in extension SYNC</div>
<div>
		&nbsp;Initializing built-in extension XKEYBOARD</div>
<div>
		&nbsp;Initializing built-in extension XC-MISC</div>
<div>
		&nbsp;Initializing built-in extension SECURITY</div>
<div>
		&nbsp;Initializing built-in extension XINERAMA</div>
<div>
		&nbsp;Initializing built-in extension XFIXES</div>
<div>
		&nbsp;Initializing built-in extension RENDER</div>
<div>
		&nbsp;Initializing built-in extension RANDR</div>
<div>
		&nbsp;Initializing built-in extension COMPOSITE</div>
<div>
		&nbsp;Initializing built-in extension DAMAGE</div>
<div>
		&nbsp;Initializing built-in extension MIT-SCREEN-SAVER</div>
<div>
		&nbsp;Initializing built-in extension DOUBLE-BUFFER</div>
<div>
		&nbsp;Initializing built-in extension RECORD</div>
<div>
		&nbsp;Initializing built-in extension DPMS</div>
<div>
		&nbsp;Initializing built-in extension X-Resource</div>
<div>
		&nbsp;Initializing built-in extension XVideo</div>
<div>
		&nbsp;Initializing built-in extension XVideo-MotionCompensation</div>
<div>
		&nbsp;Initializing built-in extension XFree86-VidModeExtension</div>
<div>
		&nbsp;Initializing built-in extension XFree86-DGA</div>
<div>
		&nbsp;Initializing built-in extension XFree86-DRI</div>
<div>
		&nbsp;Initializing built-in extension DRI2</div>
<div>
		&nbsp;Loading extension GLX</div>
</blockquote>
<p><span style="color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a><br />
再试着运行OpenCV的sample，依然不行，Google搜索到一篇<a href="http://homebrew.jp/show?page=1440" target="_blank" rel="noopener noreferrer">在Pi上运行OpenCV的文章</a>，作者做了这样一件事情：<br />
<span style="color:#0000ff;">Then I tried to run the OpenCV sample again, still the same error(&quot;cannot open display&quot;), so I Googled </span><a href="http://homebrew.jp/show?page=1440" target="_blank" rel="noopener noreferrer"><span style="color:#0000ff;"><span style="background-color:#ffa07a;">another article about using OpenCV on Pi</span></span></a><span style="color:#0000ff;">&nbsp;and found that the author did one thing:</span></p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;" style="width: 729px; ">
export DISPLAY=192.168.3.65:0.0
</pre>
<p>其中，192.168.3.65是Pi的IP地址。这样设置之后，再运行，程序不再报错了！再一看相同的目录下，生成了一个&nbsp;contours.xml 文件，说明程序执行成功了。<br />
<span style="color:#0000ff;">In which the &quot;192.168.3.65&quot; is your Pi&#39;s IP address. After setting this, the sample could run without any error&nbsp;occurred, and a contours.xml file was generated under the same directory, which indicated that we succeeded.</span></p>
<p><span style="background-color:#00ff00;">【4】</span>写一个简单的OpenCV C程序 / Write a simple OpenCV C program<br />
现在该写一个简单的OpenCV C程序来控制摄像头了。<br />
<span style="color:#0000ff;">Now we should write a simple C program to control the webcam by using OpenCV.</span></p>
<p>直接看程序：<br />
<span style="color:#0000ff;">Let&#39;s check the C code:</span></p>
<pre class="brush:cpp;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &quot;highgui.h&quot;
#include &quot;opencv.hpp&quot;

int main(int argc, char **argv) {
	/* init camera */
	CvCapture* pCapture = cvCreateCameraCapture(0);
	cvSetCaptureProperty(pCapture, CV_CAP_PROP_FRAME_WIDTH, 320); 
	cvSetCaptureProperty(pCapture, CV_CAP_PROP_FRAME_HEIGHT, 240);
	//cvSetCaptureProperty(pCapture, CV_CAP_PROP_FPS, 5);

	IplImage *pFrame = 0;

	if (NULL == pCapture) {
		fprintf(stderr, &quot;Can&#39;t initialize webcam!\n&quot;);
		return 1;
	}

	pFrame = cvQueryFrame(pCapture);	// query a frame 

	if(NULL == pFrame) {
		fprintf(stderr, &quot;Can&#39;t get a frame!\n&quot; );
		return 1;
	}

	const char *pImageFileName = &quot;webcam.jpg&quot;;
	cvSaveImage(pImageFileName, pFrame);

	cvReleaseCapture(&amp;pCapture);	// free memory

	return 0;
}
</pre>
<p>此程序做的事情非常简单：初始化摄像头，抓取一帧，然后保存为名为&ldquo;webcam.jpg&rdquo;的图片。<br />
<span style="color:#0000ff;">This program does a very simple job: initialize the camera, capture a frame &amp; save it to a image file named &quot;webcam.jpg&quot;.</span><br />
<span style="color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a><br />
编译自己的webcam程序：<br />
<span style="color:#0000ff;">Then compile the webcam program:</span></p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
g++ -I/usr/include/opencv/ -I/usr/include/opencv2/  `pkg-config --cflags opencv --libs opencv` webcam.c -o webcam
</pre>
<p>会生成一个可执行程序&ldquo;webcam&rdquo;，运行它：<br />
<span style="color:#0000ff;">This will generate an executable bin &quot;webcam&quot;, just run it:</span></p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
./webcam
</pre>
<p>然后在相同目录下，会看到生成了一个&ldquo;webcam.jpg&rdquo;图片，正是摄像头拍的照。<br />
<span style="color:#0000ff;">Then we&#39;ll get a &quot;webcam.jpg&quot; image file under the same directory, which is just the photo took by the camera.</span></p>
<p>这样，本文的主要目的就达成了。可以在此基础上继续开发其他的程序，来实现更为有用的功能，例如像<a href="http://www.codelast.com/?p=4341" target="_blank" rel="noopener noreferrer">摄像头娘</a>一样的运动检测功能。<br />
<span style="color:#0000ff;">So the main&nbsp;purpose of this article has been reached. We can develop more useful programs base on it, e.g. a program similar to the </span><a href="http://www.codelast.com/?p=4341" target="_blank" rel="noopener noreferrer"><span style="color:#0000ff;"><span style="background-color:#ffa07a;">Camera Girl</span></span></a><span style="color:#0000ff;">, which implements the motion detection&nbsp;functionality.</span><br />
<span style="color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a><br />
<span style="background-color:#00ff00;">【5】</span>遗留问题 <span style="color:#ff0000;">/</span>&nbsp;<span style="color:#0000ff;">Unsolved problems</span><br />
在上述过程中，其实我还遇到了一些未解决的问题，暂时没有时间深究，在此先记录如下。<br />
<span style="color:#0000ff;">In the above process I met some unsolved problems and have no time to explore them yet, so I just write them down here for further study.</span></p>
<p><span style="background-color:#ee82ee;">①</span>拍照时使用稍高的分辨率就导致程序崩溃 <span style="color:#ff0000;">/</span> <span style="color:#0000ff;">Use a little high resolution will cause the program crash</span><br />
在上面的程序中，如下两句是用于设置分辨率的（宽*高）：<br />
<span style="color:#0000ff;">In the above codes, the two lines below are used to set the resolution:</span></p>
<pre class="brush:cpp;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
cvSetCaptureProperty(pCapture, CV_CAP_PROP_FRAME_WIDTH, 320); 
cvSetCaptureProperty(pCapture, CV_CAP_PROP_FRAME_HEIGHT, 240);
</pre>
<p>根据我的试验，160*120的低分辨率比较少出问题，尽管320*240的分辨率对摄像头来说也根本不算高的，但是就算是使用320*240的分辨率，程序还是偶尔会崩溃的，报错如下：<br />
<span style="color:#0000ff;">According to my experiments, the 160*120 low resolution cause less crashes than higher resolutions. Even 320*240 is not a high resolution for a webcam nowadays, it still made the program crashed some times, and the error messages are:</span></p>
<pre class="brush:plain;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
[root@alarmpi c]# ./webcam 
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_REQBUFS: Cannot allocate memory
munmap: Invalid argument
munmap: Invalid argument
munmap: Invalid argument
munmap: Invalid argument
Unable to stop the stream.: Bad file descriptor
munmap: Invalid argument
munmap: Invalid argument
munmap: Invalid argument
munmap: Invalid argument
HIGHGUI ERROR: V4L: Initial Capture Error: Unable to load initial memory buffers.
Can&#39;t get a frame!
</pre>
<p><span style="color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a><br />
或者：<br />
<span style="color:#0000ff;">Or:</span></p>
<pre class="brush:plain;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
VIDIOC_REQBUFS: Cannot allocate memory
HIGHGUI ERROR: V4L/V4L2: Could not obtain specifics of capture window.

Unable to stop the stream.: Bad file descriptor
VIDIOC_QBUF: Bad file descriptor
Can&#39;t get a frame!
</pre>
<p>我不确定这是跟Pi的CPU计算能力较弱有关呢，还是跟Pi的RAM太小有关呢，还是跟摄像头的供电不足有关呢（我没有使用带电源的USB HUB来接摄像头），或者是跟摄像头的驱动有关呢？<br />
如果你知道解决办法，请赐教，非常感谢。<br />
<span style="color:#0000ff;">I&#39;m not sure whether the problem is caused by the weak computation capability of Pi&#39;s CPU, or the too-small RAM on Pi, or the&nbsp;insufficient current supply of the webcam(I didn&#39;t use a powered USB HUB to connect the webcam to Pi), or the webcam&#39;s Linux driver...<br />
If you know something, please tell me and thank you&nbsp;in advance.</span></p>
<p><span style="background-color: rgb(238, 130, 238);">2015-02-19更新：</span><br />
在树莓派model B+上，使用OpenCV 2.4.10版的上述程序，已经没有了上面所说的问题，经我测试，每隔2秒一次，连续抓取了将近30分钟的图像，一次都没有问题。</p>
<p><span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;版权声明&nbsp;<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;<br />
转载需注明出处：<u><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><em><span style="color: rgb(0, 0, 255);"><strong style="font-size: 16px;"><span style="font-family: arial, helvetica, sans-serif;">codelast.com</span></strong></span></em></a></u>&nbsp;<br />
感谢关注我的微信公众号（微信扫一扫）：</p>
<p style="border: 0px; font-size: 13px; margin: 0px 0px 9px; outline: 0px; padding: 0px; color: rgb(77, 77, 77);">
	<img decoding="async" alt="wechat qrcode of codelast" src="https://www.codelast.com/codelast_wechat_qr_code.jpg" style="width: 200px; height: 200px;" /></p>
<div id="KSFIND_MASK" style="background-color: rgb(0, 0, 0); opacity: 0.22; position: absolute !important; left: 0px !important; top: 0px !important; border: 0px none !important; padding: 0px !important; z-index: 1000000 !important; height: 0px; width: 0px; display: none; ">
	&nbsp;</div>

			<!--[syntaxhighlighter]-->
			<!--代码高亮，请勿编辑-->
			<script type="text/javascript" src="https://www.codelast.com/wp-content/plugins/ck-and-syntaxhighlighter/syntaxhighlighter/scripts/shCore.js"></script><script type="text/javascript" src="https://www.codelast.com/wp-content/plugins/ck-and-syntaxhighlighter/syntaxhighlighter/scripts/shBrushShell.js"></script>
<script type="text/javascript" src="https://www.codelast.com/wp-content/plugins/ck-and-syntaxhighlighter/syntaxhighlighter/scripts/shBrushPlain.js"></script>
<script type="text/javascript" src="https://www.codelast.com/wp-content/plugins/ck-and-syntaxhighlighter/syntaxhighlighter/scripts/shBrushCpp.js"></script>

			<link type="text/css" rel="stylesheet" href="https://www.codelast.com/wp-content/plugins/ck-and-syntaxhighlighter/syntaxhighlighter/styles/shCoreCk.css" />
			<link type="text/css" rel="stylesheet" href="https://www.codelast.com/wp-content/plugins/ck-and-syntaxhighlighter/syntaxhighlighter/styles/shThemeCk.css" />
			<script type="text/javascript">
			SyntaxHighlighter.defaults['class-name']	= '';
			SyntaxHighlighter.defaults['smart-tabs']	= true;
			SyntaxHighlighter.defaults['tab-size']		= 2;
			SyntaxHighlighter.defaults['gutter']		= true;
			SyntaxHighlighter.defaults['quick-code']	= true;
			SyntaxHighlighter.defaults['collapse'] 		= false;
			SyntaxHighlighter.defaults['auto-links']	= true;
			SyntaxHighlighter.defaults['toolbar']		= true;
			SyntaxHighlighter.all();
			</script>
			<!--[/syntaxhighlighter]-->]]></content:encoded>
					
					<wfw:commentRss>https://www.codelast.com/%e5%8e%9f%e5%88%9b%e5%9c%a8raspberry-pi%e4%b8%8a%e7%94%a8opencv%e6%9d%a5%e6%93%8d%e7%ba%b5%e6%91%84%e5%83%8f%e5%a4%b4%e6%8b%8d%e7%85%a7use-opencv-on-raspberry-pi-to-controll-a-webcam-to-take-photos/feed/</wfw:commentRss>
			<slash:comments>8</slash:comments>
		
		
			</item>
		<item>
		<title>[原创]Raspberry Pi(树莓派)配置记录/Configure the Arch Linux ARM on Raspberry Pi</title>
		<link>https://www.codelast.com/%e5%8e%9f%e5%88%9braspberry-pi%e6%a0%91%e8%8e%93%e6%b4%be%e9%85%8d%e7%bd%ae%e8%ae%b0%e5%bd%95configure-the-arch-linux-arm-on-raspberry-pi/</link>
					<comments>https://www.codelast.com/%e5%8e%9f%e5%88%9braspberry-pi%e6%a0%91%e8%8e%93%e6%b4%be%e9%85%8d%e7%bd%ae%e8%ae%b0%e5%bd%95configure-the-arch-linux-arm-on-raspberry-pi/#comments</comments>
		
		<dc:creator><![CDATA[learnhard]]></dc:creator>
		<pubDate>Thu, 18 Oct 2012 07:38:36 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Raspberry Pi/树莓派]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[Arch Linux ARM]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[教程]]></category>
		<category><![CDATA[树莓派]]></category>
		<category><![CDATA[配置]]></category>
		<guid isPermaLink="false">http://www.codelast.com/?p=4945</guid>

					<description><![CDATA[<p>
<span style="background-color: rgb(0, 255, 0); ">For non-Chinese readers:</span><br />
<span style="color: rgb(0, 0, 255); ">I&#39;m a software engineer in Shanghai, China, and since I bought a Raspberry Pi, I spent some spare time on it and I&#39;m glad to share something with Pi users all over the world, so this article has two languages: Chinese &#38; English, and I try to translate the Chinese to English as&#160;accurately as possible, but, there might be some translation mistakes, so if you don&#39;t know what I mean in the article, just leave a comment, and I&#39;ll reply when I get an answer.</span>&#8230; <a href="https://www.codelast.com/%e5%8e%9f%e5%88%9braspberry-pi%e6%a0%91%e8%8e%93%e6%b4%be%e9%85%8d%e7%bd%ae%e8%ae%b0%e5%bd%95configure-the-arch-linux-arm-on-raspberry-pi/" class="read-more">Read More </a></p>]]></description>
										<content:encoded><![CDATA[<p>
<span style="background-color: rgb(0, 255, 0); ">For non-Chinese readers:</span><br />
<span style="color: rgb(0, 0, 255); ">I&#39;m a software engineer in Shanghai, China, and since I bought a Raspberry Pi, I spent some spare time on it and I&#39;m glad to share something with Pi users all over the world, so this article has two languages: Chinese &amp; English, and I try to translate the Chinese to English as&nbsp;accurately as possible, but, there might be some translation mistakes, so if you don&#39;t know what I mean in the article, just leave a comment, and I&#39;ll reply when I get an answer. Also welcome to contact me via&nbsp;<a href="http://www.codelast.com/?page_id=2" target="_blank" rel="noopener noreferrer">Email</a>.</span><br />
<a href="http://www.raspberrypi.org/" target="_blank" rel="noopener noreferrer"><br />
Raspberry Pi</a>是什么？<br />
引用维基百科的一句话：</p>
<blockquote>
<p>
		The Raspberry Pi is a credit card sized single-board computer developed in the UK by the Raspberry Pi Foundation with the intention of stimulating the teaching of basic computer science in schools.</p>
</blockquote>
<p>简单地说，它就是一个基于ARM CPU的、信用卡那么大的迷你计算机。<br />
<span style="color: rgb(0, 0, 255); ">In short, Pi is an ARM-based mini computer which has a credit card size.</span><br />
<span id="more-4945"></span></p>
<div style="text-align: center; ">
	<img decoding="async" alt="Raspberry Pi" src="https://www.codelast.com/wp-content/uploads/2012/10/raspberry_pi.jpg" style="width: 367px; height: 248px; " /></div>
<p>
这货能拿来干嘛？由于它是一台计算机，并且它有着很迷你的体积，最关键的，它还很便宜，因此，用处实在太多了。有人拿它来<a href="http://v.youku.com/v_show/id_XNDMwMTQ2MTQw.html" target="_blank" rel="noopener noreferrer">控制玩具</a>，<a href="http://brewpi.com/" target="_blank" rel="noopener noreferrer">有人拿它来酿酒</a>，甚至还<a href="http://www.ifanr.com/158379" target="_blank" rel="noopener noreferrer">有人拿它来做超级计算机</a>！<br />
是的，这帮人确实太能玩了...<br />
<span style="color:#0000ff;">What can you use it for? Because it&#39;s a computer which has a very mini size, and most importantly, it&#39;s cheap enough, so it&#39;s really useful. Someone use it to </span><a href="http://v.youku.com/v_show/id_XNDMwMTQ2MTQw.html" target="_blank" rel="noopener noreferrer"><span style="color:#0000ff;"><span style="background-color:#ffa07a;">control a toy</span></span></a><span style="color:#0000ff;">(people outside China mainland may not able to visit this video link due to copyright reason), someone use it to </span><a href="http://brewpi.com/" target="_blank" rel="noopener noreferrer"><span style="color:#0000ff;"><span style="background-color:#ffa07a;">brew beer</span></span></a><span style="color:#0000ff;">, and someone even </span><a href="http://www.engadget.com/2012/09/13/supercomputer-built-from-raspberry-pi-and-lego/" target="_blank" rel="noopener noreferrer"><span style="color:#0000ff;"><span style="background-color:#ffa07a;">used Pis to build a supercomputer</span></span></a><span style="color:#0000ff;">!</span><br />
<span style="color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a><br />
我在Raspberry Pi上安装的系统是官方推荐的几个系统之一：Arch Linux ARM（这不是第一推荐的那个Raspbian）。<br />
<span style="color:#0000ff;">What I installed on Pi is one of the&nbsp;official recommended Operation Systems: Arch Linux ARM(but this is not the most recommended Raspbian).</span></p>
<p>一开始我也是先尝试使用官方推荐的Raspbian，但是由于在刷好系统之后，进入系统之前进行配置的时候，对键盘布局的配置无论如何都无法保存，一直有一个error，导致无法正常使用键盘，所以我最终只能放弃了它，转而使用Arch Linux ARM，这就意味着自己需要做很多的配置工作了。<br />
下面各项，就是我在折腾的过程中遇到的各种问题以及解决办法。<br />
<span style="color:#0000ff;">At first I was trying to use the most official recommended OS - Raspbian, but after writing the OS image to my SD card, and before logging into the system, I met an keyboard layout configuration error in the configuration step, no matter how many times I tried, it&#39;s always the same, so I had to turn to Arch Linux ARM, which means that I need to do lots of configuration work myself.</span><br />
<span style="color:#0000ff;">Below notes, are the problems I met in the process of configuring Pi and the solutions.</span></p>
<p><span style="background-color:#00ff00;">【1】</span>关于分区 <span style="color:#ff0000;">/</span> <span style="color:#0000ff;">About the partitions</span><br />
如果你是在Windows下刷的Arch Linux ARM系统，那么，你可能是用官方推荐的<a href="https://launchpad.net/win32-image-writer/+download" target="_blank" rel="noopener noreferrer">Win32DiskImager</a>软件来刷的。Arch Linux ARM的镜像文件（一个.img文件）有约1.8G大，用Win32DiskImager将其刷到SD卡上之后，会发现根目录&ldquo;/&rdquo;所在的分区只有1点几G大，并且没有交换空间（swap），这很麻烦，因为我们随便装几个软件就会占满根目录所在分区，例如一个emacs就有几百M大。<br />
<span style="color:#0000ff;">If you wrote the OS image to SD card on Windows, you might use the official recommended&nbsp;</span><a href="https://launchpad.net/win32-image-writer/+download" target="_blank" rel="noopener noreferrer"><span style="color:#0000ff;"><span style="background-color:#ffa07a;">Win32DiskImager</span></span></a><span style="color:#0000ff;">&nbsp;to do the work. The Arch Linux ARM OS image file(an .img file) has a size about 1.8GB, after you use&nbsp;Win32DiskImager to write it to a SD card, you&#39;ll find that the partition which contains the root directory &quot;/&quot; has a space of 1.X GB, and there is no swap partition - this is a trouble because the partition space will be used up soon, e.g. installing emacs related packages will use more than 200 MB space.</span></p>
<p>所以，我们要让根目录几乎使用全部的SD卡空间。例如，我的SD卡是16G的，我想把1G空间拿来做swap，其余的就给根目录了。<br />
<span style="color:#0000ff;">So, I need to let the root directory partition use almost the whole SD card space. For example, I have a 16GB SD card, then I want 1GB to be the swap, and the left space to be the root directory partition.</span><br />
<a href="http://www.youtube.com/watch?v=DztSRaFyaVE" target="_blank" rel="noopener noreferrer">Youtube上有教程</a>说明如何用<a href="http://gparted.sourceforge.net/" target="_blank" rel="noopener noreferrer">GParted</a>（一款开源软件）来操作SD卡，从而将更改系统分区的大小，我也曾尝试，不幸的是我在调整好空间大小之后，一点击&ldquo;Apply&rdquo;应用我的修改就出错，无法继续下去。所以我最后是采取了一个最简单，也成功了的办法，那就是：使用Ubuntu系统自带的磁盘管理工具来重新分区，听我慢慢道来：<br />
<span style="color:#0000ff;">There is </span><a href="http://www.youtube.com/watch?v=DztSRaFyaVE" target="_blank" rel="noopener noreferrer"><span style="color:#0000ff;"><span style="background-color:#ffa07a;">a video tutorial</span></span></a><span style="color:#0000ff;"> on Youtube teaching you how to resize the partition to full SD card capacity by using <a href="http://gparted.sourceforge.net/" target="_blank" rel="noopener noreferrer"><span style="background-color:#ffa07a;">GParted</span></a>(an open-source software). I tried that, but failed all the times, whenever I clicked the &quot;Apply&quot; button I got an error and couldn&#39;t continue, so at last I used a very simple way to do the same work, and it worked, that is, I used the disk management tool in Ubuntu to &quot;resize&quot; the SD card partition, as following:</span><br />
<span style="background-color:#ffff00;">（1）</span>进入Ubuntu系统，将SD卡上1点几G的那个分区（也就是根目录所在的分区）里的文件备份成tar包：<br />
<span style="color:#0000ff;">Logging into Ubuntu and backup the files in the SD card root partition with a size of 1.X GB to a tar package:</span></p>
<pre style="margin-top: 0px; margin-bottom: 0px; font-stretch: normal; font-size: 0.9333em; line-height: 1.5em; font-family: Consolas, &quot;Lucida Console&quot;, &quot;DejaVu Sans Mono&quot;, Monaco, &quot;Courier New&quot;, monospace; background: rgb(0, 34, 64); color: rgb(255, 255, 255);">
tar cf os.tar XXX/<span style="color: rgb(255, 157, 0);">*</span></pre>
<p>其中，XXX是指你的SD卡目录。<br />
这个备份出来的tar包在后面我们修改完分区大小之后，恢复系统的时候要用。<br />
<span style="color:#0000ff;">The XXX refers to you SD card directory and the tar package will be used to restore your OS after resizing the partition.</span><br />
<span style="color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a><br />
<span style="background-color:#ffff00;">（2）</span>用Ubuntu系统自带的图形化磁盘管理工具（具体名字记不得了），删除掉1点几G的那个SD卡分区，同时你会发现，有一个十几G的未分配的空间，这就是我们要利用的宝贵空间。然后划分出一个13G的ext4分区（Pi官方推荐的那个Arch Linux ARM镜像刷出来的系统用的就是ext4文件系统），这将作为新的系统所在分区。<br />
<span style="color:#0000ff;">Use the graphical disk management tool(I forget the software name, sorry) to delete the SD card partition with the size of 1.X GB, and you&#39;ll find that there is an &quot;unallocated&quot; partition which has a size of &gt; 10GB(</span><span style="color:#000080;">NOTE: my SD card is a 16GB card</span><span style="color:#0000ff;">) - it&#39;s just the free space we want to use. Then create a 13GB partition with ext4 format, which will be used as the new OS partition.</span><br />
<span style="background-color:#ffff00;">（3）</span>将剩下的空间划分为一个交换空间（swap），如果你觉得此空间太大有点浪费，那么你可以在上一步里把空间设大一点，那么这里剩下的swap空间就会小一点，总之，自己衡量。<br />
<span style="color:#0000ff;">Use the left space to create a swap partition. If you think that it&#39;s a waste to allocate so much space to swap, you can allocate more space to OS partition in the previous step. Anyway, judge it by yourself.</span><br />
<span style="background-color:#ffff00;">（4）</span>待Ubuntu操作完成，把SD卡挂载上去，现在，你就有了一个十几G的系统分区和一个1G的swap分区。但是，由于重新分区，系统已经没了，我们怎么恢复？用刚才备份的tar文件就可以恢复。将其中的文件解压到十几G的系统分区里，你原来的设置、安装的软件都不会丢。但是要注意，可能你解压文件的时候，用的不是root用户，而是其他用户，那么你要保证解压出来之后，要修改所有文件的权限为root：<br />
<span style="color:#0000ff;">After the partition operation finished, just mount the SD card, then you&#39;ll find that you have a &gt; 10GB OS partition and a swap partition, but you lost the OS on the partition, so, how to restore the OS? Remember the tar file we backup before? Yes, unpack the files in the tar package to the OS partition, you&#39;ll get your previous OS back! But note that, when unpacking the tar file, you may use a non-root Ubuntu account, so after the unpacking done, we should change the ownership of all files/directories:</span></p>
<pre style="margin-top: 0px; margin-bottom: 0px; font-stretch: normal; font-size: 0.9333em; line-height: 1.5em; font-family: Consolas, &quot;Lucida Console&quot;, &quot;DejaVu Sans Mono&quot;, Monaco, &quot;Courier New&quot;, monospace; background: rgb(0, 34, 64); color: rgb(255, 255, 255);">
chown -R root:root XXX/</pre>
<p>其中，XXX为你的SD卡的挂载目录。这是因为刚刷到Pi上的Arch Linux ARM只有一个root用户，我没有添加其他用户，所有文件owner均为root。<br />
<span style="color:#0000ff;">The XXX refers to your SD card mounted directory. I do this because I didn&#39;t add any other user for my Arch Linux ARM, except the root user.</span><br />
<span style="background-color:#ffff00;">（5）</span>把SD卡umount下来，插入Pi的卡槽中，启动系统，发现一切正常，成功了！<br />
<span style="color:#0000ff;">Then umount the SD card from Ubuntu, plug it into Pi, and boot Pi, everything is OK, it works with no problem.</span><br />
<span style="color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a><br />
<span style="background-color:#00ff00;">【2】</span>添加开机启动的程序 <span style="color:#ff0000;">/</span> <span style="color:#0000ff;">Run your program on OS startup</span><br />
要让Pi开机启动一个脚本/执行一个命令怎么办？<br />
我们知道，RedHat有 /etc/rc.local 文件，在里面写上要执行的命令就可以开机执行了，这是最简单的办法，而Arch Linux ARM没有这个东西，它是按下面的方法设置的：<br />
假设我要开机执行一句shell命令，把它写在文件 /etc/rc.local 中（在Arch Linux中，此文件一开始是不存在的）：<br />
<span style="color:#0000ff;">How to execute a shell script/a command on Pi startup?<br />
For RedHat it&#39;s very easy, it has a /etc/rc.local file, we just add the commands to the file, while Arch Linux ARM doesn&#39;t have such thing, and I&#39;m a beginner of Arch, so after asking Google for many times, I find a way to do that - suppose I need to execute a shell command, so I create the /etc/rc.local file &amp; write the shell command to it:</span></p>
<pre style="margin-top: 0px; margin-bottom: 0px; font-stretch: normal; font-size: 0.9333em; line-height: 1.5em; font-family: Consolas, &quot;Lucida Console&quot;, &quot;DejaVu Sans Mono&quot;, Monaco, &quot;Courier New&quot;, monospace; background: rgb(0, 34, 64); color: rgb(255, 255, 255);">
<span style="color: rgb(0, 136, 255); font-style: italic;"><span style="color: rgb(225, 239, 255);">#</span>!/bin/bash</span>
<span style="color: rgb(0, 136, 255); font-style: italic;"><span style="color: rgb(225, 239, 255);">#</span> this file defines the commands that will be executed at system startup</span>

<span style="color: rgb(255, 176, 84);">echo</span> <span style="color: rgb(58, 217, 0);">&quot;</span>abc<span style="color: rgb(58, 217, 0);">&quot;</span> <span style="color: rgb(255, 157, 0);">&gt;</span> /root/test.txt</pre>
<p>为此文件赋予可执行权限：<br />
<span style="color:#0000ff;">Give the file the executable permission:</span></p>
<pre style="margin-top: 0px; margin-bottom: 0px; font-stretch: normal; font-size: 0.9333em; line-height: 1.5em; font-family: Consolas, &quot;Lucida Console&quot;, &quot;DejaVu Sans Mono&quot;, Monaco, &quot;Courier New&quot;, monospace; background: rgb(0, 34, 64); color: rgb(255, 255, 255);">
chmod +x /etc/rc.<span style="color: rgb(255, 238, 128);">local</span></pre>
<p>然后创建一个文件&nbsp;<span style="color:#b22222;">/usr/lib/systemd/system/rc-local.service</span>&nbsp;，内容为：<br />
<span style="color:#0000ff;">Then create a file&nbsp;</span><span style="color:#b22222;">/usr/lib/systemd/system/rc-local.service</span><span style="color:#0000ff;">&nbsp;, with the content of:</span></p>
<blockquote>
<div>
		[Unit]</div>
<div>
		Description=/etc/rc.local Compatibility</div>
<div>
		ConditionPathExists=/etc/rc.local</div>
<div>
		&nbsp;</div>
<div>
		[Service]</div>
<div>
		Type=forking</div>
<div>
		ExecStart=/etc/rc.local start</div>
<div>
		TimeoutSec=0</div>
<div>
		StandardOutput=tty</div>
<div>
		RemainAfterExit=yes</div>
<div>
		SysVStartPriority=99</div>
<div>
		&nbsp;</div>
<div>
		[Install]</div>
<div>
		WantedBy=multi-user.target</div>
</blockquote>
<p><span style="color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a><br />
创建一个软链接：<br />
<span style="color:#0000ff;">Create a symbol link:</span></p>
<pre style="margin-top: 0px; margin-bottom: 0px; font-stretch: normal; font-size: 0.9333em; line-height: 1.5em; font-family: Consolas, &quot;Lucida Console&quot;, &quot;DejaVu Sans Mono&quot;, Monaco, &quot;Courier New&quot;, monospace; background: rgb(0, 34, 64); color: rgb(255, 255, 255);">
<span style="color: rgb(255, 176, 84);">cd</span> /etc/systemd/system/multi-user.target.wants
ln -s /usr/lib/systemd/system/rc-local.service rc-local.service</pre>
<p>启用服务：<br />
<span style="color:#0000ff;">Enable the service:</span></p>
<pre style="margin-top: 0px; margin-bottom: 0px; font-stretch: normal; font-size: 0.9333em; line-height: 1.5em; font-family: Consolas, &quot;Lucida Console&quot;, &quot;DejaVu Sans Mono&quot;, Monaco, &quot;Courier New&quot;, monospace; background: rgb(0, 34, 64); color: rgb(255, 255, 255);">
systemctl <span style="color: rgb(255, 176, 84);">enable</span> rc-local.service</pre>
<p>重启系统，然后就可以开机执行你的shell命令了。如果要立即启用，则执行以下命令：<br />
<span style="color:#0000ff;">Restart Pi, then you&#39;ll be able to execute the shell command on OS startup. If you want to execute it without restarting Pi, just execute the following command:</span></p>
<pre style="margin-top: 0px; margin-bottom: 0px; font-stretch: normal; font-size: 0.9333em; line-height: 1.5em; font-family: Consolas, &quot;Lucida Console&quot;, &quot;DejaVu Sans Mono&quot;, Monaco, &quot;Courier New&quot;, monospace; background: rgb(0, 34, 64); color: rgb(255, 255, 255);">
systemctl start rc-local.service</pre>
<p>这是使用systemd的启动方式，非常麻烦。<br />
如果你只是简单地要设置一个命令的别名，可以把命令写在 /etc/profile 中，ssh登录Pi的时候就自动会执行。<br />
<span style="color:#0000ff;">This seems to be the so-called &quot;systemd&quot; way to start something, and I think the setup process is very tedious.</span><br />
<span style="color:#0000ff;">You can also add the shell command to /etc/profile, and it will be executed when you logging into Pi using ssh.</span></p>
<p><span style="background-color:#00ff00;">【3】</span>安装软件 <span style="color:#ff0000;">/</span> <span style="color:#0000ff;">Install packages</span><br />
在Arch Linux上安装软件使用pacman很方便，它相当于Ubuntu中的apt-get。例如，要安装gcc，可以这样：<br />
<span style="color:#0000ff;">It&#39;s very convenient to use </span><span style="color:#b22222;">pacman</span><span style="color:#0000ff;"> to install something on Arch Linux, and it&#39;s the&nbsp;equivalent of apt-get on Ubuntu. For example, you can install gcc by typing:</span></p>
<pre style="margin-top: 0px; margin-bottom: 0px; font-stretch: normal; font-size: 0.9333em; line-height: 1.5em; font-family: Consolas, &quot;Lucida Console&quot;, &quot;DejaVu Sans Mono&quot;, Monaco, &quot;Courier New&quot;, monospace; background: rgb(0, 34, 64); color: rgb(255, 255, 255);">
pacman -S gcc</pre>
<p>然后Arch Linux ARM会提示你要下载的软件包的情况，以及向你确认是否要进行安装。<br />
在下载软件包的过程中，我的Pi一直提示下载不到某一个软件包的错误，重试无数遍都一样，于是我就只能尝试升级pacman以及系统了，执行：<br />
<span style="color:#0000ff;">Then Arch Linux will prompt you the info of the packages which will be downloaded/installed, and ask you to confirm the installation.<br />
In the process of downloading a gcc related package, I met an URL not found error and I tried many times but solved nothing, so at last I tried to update pacman and the OS:</span></p>
<pre style="margin-top: 0px; margin-bottom: 0px; font-stretch: normal; font-size: 0.9333em; line-height: 1.5em; font-family: Consolas, &quot;Lucida Console&quot;, &quot;DejaVu Sans Mono&quot;, Monaco, &quot;Courier New&quot;, monospace; background: rgb(0, 34, 64); color: rgb(255, 255, 255);">
pacman -Syu</pre>
<p>升级时间较长（大约小于10分钟），之后再安装gcc，就成功了。<br />
<span style="color:#0000ff;">This consumes a bit long time(but &lt; 10 min, depends on your Internet connection speed), and after this I tried to install gcc again, it succeeded.</span><br />
<span style="color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a><br />
<span style="color:#000000;"><span style="background-color:#00ff00;">【4】</span>配置静态IP地址 </span><span style="color:#ff0000;">/ </span><span style="color:#0000ff;">Set up a static IP address</span><br />
<span style="color:#000000;"> 相比设置一个静态的IP地址，我更愿意采取另一种简单的办法来让Pi每次都得到一个固定的IP地址，即：在路由器里为Pi所对应的Mac地址保留一个固定的IP地址。<br />
由于我对Pi所接入的网络的路由器有完全的控制权，所以我可以这样做。由于每种路由器的管理界面是不相同的，所以在此我就不把路由器管理界面的图贴上来了，大家自己看看你路由器的说明书就会弄了。</span><br />
<span style="color:#0000ff;">Comparing to setting up a static IP for Pi, I would like more to take another simple way to let Pi get a fixed IP everytime it accesses to the same network, that is, let the router to allocate(reserve) a fixed IP for Pi&#39;s Mac address.<br />
This can be done only because I have full control over the router which Pi accesses. Because different routers have different admin interfaces, so I post no sample images here and you can check the instruction book of your router to figure out how to set it.</span></p>
<p><span style="background-color: rgb(0, 255, 0); ">【5】</span>设置系统时区 &amp; 时间 <span style="color:#ff0000;">/</span> <span style="color:#0000ff;">System timezone &amp; time setup</span><br />
以上海为例，先编辑文件&nbsp;/etc/rc.conf，添加上如下内容：<br />
<span style="color:#0000ff;">Use Shanghai as an example, first we should edit file /etc/rc.conf and add the following content:</span></p>
<blockquote>
<div>
		LOCALE=&quot;en_US.UTF-8&quot;</div>
<div>
		DAEMON_LOCALE=&quot;no&quot;</div>
<div>
		HARDWARECLOCK=&quot;localtime&quot;</div>
<div>
		TIMEZONE=&quot;Asia/Shanghai&quot;</div>
</blockquote>
<p>然后做软链接：<br />
<span style="color:#0000ff;">Then make a symbolic link:</span></p>
<pre style="margin-top: 0px; margin-bottom: 0px; font-stretch: normal; font-size: 0.9333em; line-height: 1.5em; font-family: Consolas, &quot;Lucida Console&quot;, &quot;DejaVu Sans Mono&quot;, Monaco, &quot;Courier New&quot;, monospace; background: rgb(0, 34, 64); color: rgb(255, 255, 255);">
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime</pre>
<p>/etc/localtime 原来是指向&nbsp;/usr/share/zoneinfo/Europe/London，在做这外软链接之后，就指向了&nbsp;/usr/share/zoneinfo/Asia/Shanghai。<br />
<span style="color:#0000ff;">The /etc/localtime was initially pointed to&nbsp;/usr/share/zoneinfo/Europe/London and after we made a new link, it will points to&nbsp;/usr/share/zoneinfo/Asia/Shanghai.</span><br />
<span style="color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a><br />
这样就算设置好了时区了。下面该设置系统时间了。由于树莓派没有实时时钟，因此，最好利用网络来对时，所以使用<a href="http://www.openntpd.org/" target="_blank" rel="noopener noreferrer"><span style="background-color:#ffa07a;">OpenNTPD</span></a>是个非常好的选择。<br />
<span style="color:#0000ff;">So the timezone setup is done. Then we should setup the system time. Because Pi doesn&#39;t has a real-time clock built in, we better use the network to synchronize the system time, so using the <a href="http://www.openntpd.org/" target="_blank" rel="noopener noreferrer"><span style="background-color:#ffa07a;">OpenNTPD</span></a> is a good choice.</span><br />
我系统中安装的OpenNTPD（我不记得是系统自带的还是我安装的了）：<br />
<span style="color:#0000ff;">The OpenNTPD in my Arch Linux ARM(I forget whether it&#39;s installed by me or not):</span></p>
<pre style="margin-top: 0px; margin-bottom: 0px; font-stretch: normal; font-size: 0.9333em; line-height: 1.5em; font-family: Consolas, &quot;Lucida Console&quot;, &quot;DejaVu Sans Mono&quot;, Monaco, &quot;Courier New&quot;, monospace; background: rgb(0, 34, 64); color: rgb(255, 255, 255);">
[root@alarmpi <span style="color: rgb(255, 157, 0);">~</span>]# pacman -Q <span style="color: rgb(255, 157, 0);">|</span> grep ntp
openntpd 3.9p1-19</pre>
<p>确保 /etc/rc.conf 中有OpenNTPD的启动项：<br />
<span style="color:#0000ff;">Make sure that the OpenNTPD is in the auto startup list in /etc/rc.conf :</span></p>
<blockquote>
<p>
		DAEMONS=(syslog-ng network netfs crond openntpd sshd)</p>
</blockquote>
<p>然后重启系统，会发现时间自动同步正确了。<br />
<span style="color:#0000ff;">Then reboot the system and you&#39;ll find that the time is correct.</span><br />
如果你发现时间无法同步，那么请执行一下ntpd命令，该命令会加载ntpd配置文件 /etc/ntpd.conf，如果配置文件内容有错，它会提示出来。就算配置文件是正确的，有其他错误也会打印出来。<br />
例如，我升级了如下版本的系统：<br />
<span style="color:#0000ff;">If you find that the time cannot be&nbsp;synchronized, then you should execute the ntpd command to see what the problem is. The ntpd command will load configuration file /etc/ntpd.conf and if there is any problem in it, the command will tell you. Even the content of the conf file is correct, the ntpd command will print other error messages out.<br />
E.g. I upgraded my OS to following version:</span></p>
<pre style="margin-top: 0px; margin-bottom: 0px; font-stretch: normal; font-size: 0.9333em; line-height: 1.5em; font-family: Consolas, &quot;Lucida Console&quot;, &quot;DejaVu Sans Mono&quot;, Monaco, &quot;Courier New&quot;, monospace; background: rgb(0, 34, 64); color: rgb(255, 255, 255);">
[root@alarmpi <span style="color: rgb(255, 157, 0);">~</span>]# cat /proc/version 
Linux version 3.2.27-14-ARCH+ <span style="color: rgb(225, 239, 255);">(</span>nobody@nitrogen<span style="color: rgb(225, 239, 255);">)</span> <span style="color: rgb(225, 239, 255);">(</span>gcc version 4.7.2 <span style="color: rgb(225, 239, 255);">(</span>GCC<span style="color: rgb(225, 239, 255);">)</span> <span style="color: rgb(225, 239, 255);">)</span> <span style="color: rgb(0, 136, 255); font-style: italic;"><span style="color: rgb(225, 239, 255);">#</span>1 PREEMPT Tue Nov 20 23:58:09 UTC 2012</span></pre>
<p>然后就遇到了无法同步时间的问题。执行ntpd命令会提示&ldquo;ntpd: unknown user ntp&rdquo;。网上Google了一堆文章，找到最后唯一一个可行的解决办法就是：为系统添加一个&ldquo;ntp&rdquo;用户：<br />
<span style="color:#0000ff;">Then I couldn&#39;t&nbsp;synchronized the time. When executing ntpd command it prompted &quot;ntpd: unknown user ntp&quot;. After Googling a lot of solutions I found the only one which can solve the problem, that is, add a &quot;ntp&quot; user for the OS:</span></p>
<pre style="margin-top: 0px; margin-bottom: 0px; font-stretch: normal; font-size: 0.9333em; line-height: 1.5em; font-family: Consolas, &quot;Lucida Console&quot;, &quot;DejaVu Sans Mono&quot;, Monaco, &quot;Courier New&quot;, monospace; background: rgb(0, 34, 64); color: rgb(255, 255, 255);">
useradd ntp</pre>
<p>然后查看 /etc/passwd 文件，会看到已经添加了该用户。<br />
<span style="color:#0000ff;">Then check /etc/passwd to make sure the user has been added.</span><br />
为安全，编辑 /etc/passwd 文件，将此用户设置为无法ssh登录系统：<br />
<span style="color:#0000ff;">For security reason, edit /etc/passwd to forbid the user to login the OS:</span></p>
<pre style="margin-top: 0px; margin-bottom: 0px; font-stretch: normal; font-size: 0.9333em; line-height: 1.5em; font-family: Consolas, &quot;Lucida Console&quot;, &quot;DejaVu Sans Mono&quot;, Monaco, &quot;Courier New&quot;, monospace; background: rgb(0, 34, 64); color: rgb(255, 255, 255);">
ntp:x:1000:1000::/home/ntp:/sbin/nologin</pre>
<p><span style="color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a><br />
另外，你也可以用ntpdate（现在已经被官方<a href="http://support.ntp.org/bin/view/Dev/DeprecatingNtpdate" target="_blank" rel="noopener noreferrer"><span style="background-color:#ffa07a;">弃用</span></a>了）来对时，但首先你必须安装ntp包：<br />
<span style="color:#0000ff;">You can also use ntpdate(which is now <a href="http://support.ntp.org/bin/view/Dev/DeprecatingNtpdate" target="_blank" rel="noopener noreferrer"><span style="background-color:#ffa07a;">deprecated</span></a>) to sync the time, but you have to install package ntp first:</span></p>
<pre style="margin-top: 0px; margin-bottom: 0px; font-stretch: normal; font-size: 0.9333em; line-height: 1.5em; font-family: Consolas, &quot;Lucida Console&quot;, &quot;DejaVu Sans Mono&quot;, Monaco, &quot;Courier New&quot;, monospace; background: rgb(0, 34, 64); color: rgb(255, 255, 255);">
pacman -S ntp</pre>
<p>然后，找一个可用的时间服务器来同步时间：<br />
<span style="color:#0000ff;">And then find an available time server to sync the time:</span></p>
<pre style="margin-top: 0px; margin-bottom: 0px; font-stretch: normal; font-size: 0.9333em; line-height: 1.5em; font-family: Consolas, &quot;Lucida Console&quot;, &quot;DejaVu Sans Mono&quot;, Monaco, &quot;Courier New&quot;, monospace; background: rgb(0, 34, 64); color: rgb(255, 255, 255);">
ntpdate  <span style="color: rgb(255, 157, 0);">time</span>.buptnet.edu.cn</pre>
<p>
<span style="background-color: rgb(0, 255, 0); ">【6】</span>配置Emacs编辑C++代码的自动补全功能 <span style="color:#ff0000;">/</span> <span style="color:#0000ff;">Configure the auto-complete for editing C++ source in Emacs</span><br />
如果要在树莓派上用Emacs开发C++程序，那么配置好代码自动补全/自动完成功能大有帮助。<br />
<span style="color:#0000ff;">If you want to use Emacs to write C++ code on Pi, then the auto-completion should be a big help to you.</span><br />
<a href="http://cedet.sourceforge.net/" target="_blank" rel="noopener noreferrer"><span style="background-color:#ffa07a;">CEDET</span></a>实现了该功能，用的人也比较多，不过，由于树莓派的性能较低，并且CEDET很慢（很多文章都这么说，我没试），所以就不要考虑在树莓派上用这玩意了。<br />
<span style="color:#0000ff;">Many people use&nbsp;</span><span style="background-color: rgb(255, 160, 122); "><a href="http://cedet.sourceforge.net/" target="_blank" rel="noopener noreferrer"><span style="color:#0000ff;">CEDET</span></a></span><span style="color:#0000ff;">&nbsp;to do the auto-completion job, but because of the low performance of Pi, and the CEDET is very slow(many articles said that, but I didn&#39;t try it), so just choose something else but not CEDET on Pi.</span><br />
<span style="color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a><br />
那么应该选择什么Emacs插件来实现呢？<a href="https://github.com/brianjcj/auto-complete-clang" target="_blank" rel="noopener noreferrer"><span style="background-color:#ffa07a;">auto-complete-clang</span></a>是一个很好的选择。<br />
<span style="color:#0000ff;">So what Emacs plugin we should use? the&nbsp;</span><a href="https://github.com/brianjcj/auto-complete-clang" target="_blank" rel="noopener noreferrer"><span style="background-color: rgb(255, 160, 122); ">auto-complete-clang</span></a><span style="color:#0000ff;">&nbsp;is a good choice.</span><br />
下面，就介绍一下如何配置该插件，让自动完成功能在Emacs中用起来。<br />
<span style="color:#0000ff;">Then I&#39;ll tell you how to configure the plugin to get the auto-completion work.</span><br />
为了安装auto-complete-clang，你需要先安装两个东西：<a href="http://cx4a.org/pub/auto-complete/" target="_blank" rel="noopener noreferrer"><span style="background-color:#ffa07a;">auto-complete</span></a>&nbsp;和&nbsp;<a href="http://clang.llvm.org/" target="_blank" rel="noopener noreferrer"><span style="background-color:#ffa07a;">clang</span></a>。<br />
<span style="color:#0000ff;">Before installing&nbsp;auto-complete-clang, you must install another two software first:</span><a href="http://cx4a.org/pub/auto-complete/" target="_blank" rel="noopener noreferrer"><span style="background-color: rgb(255, 160, 122); ">auto-complete</span></a><span style="color:#0000ff;">&nbsp;and&nbsp;</span><a href="http://clang.llvm.org/" target="_blank" rel="noopener noreferrer"><span style="background-color: rgb(255, 160, 122); ">clang</span></a><span style="color:#0000ff;">.</span><br />
<span style="background-color:#00ffff;">①</span>安装auto-complete <span style="color:#ff0000;">/</span> <span style="color:#0000ff;">Install auto-complete</span><br />
首先你要下载auto-complete的源码包，解压之后编译，安装（安装的过程中会询问你安装到哪个目录）：<br />
<span style="color:#0000ff;">Download the source package, unpack it, compile it &amp; install it(you&#39;ll be asked to type an installation directory in the process):</span></p>
<pre style="margin-top: 0px; margin-bottom: 0px; font-stretch: normal; font-size: 0.9333em; line-height: 1.5em; font-family: Consolas, &quot;Lucida Console&quot;, &quot;DejaVu Sans Mono&quot;, Monaco, &quot;Courier New&quot;, monospace; background: rgb(0, 34, 64); color: rgb(255, 255, 255);">
make
make install
Install to: /root/.emacs.d/auto-complete</pre>
<p>注意，我把它安装到了一个自己创建的目录下，后面要用到这个目录里的文件。<br />
<span style="color:#0000ff;">Note that I installed it to a directory created by me and we&#39;ll use the directory later.</span><br />
在Emacs配置文件.emacs中添加如下四行：<br />
<span style="color:#0000ff;">Add the following 4 lines in the Emacs configuration file .emacs:</span></p>
<blockquote>
<div>
		(add-to-list &#39;load-path &quot;/root/.emacs.d/auto-complete&quot;)</div>
<div>
		(require &#39;auto-complete-config)</div>
<div>
		(add-to-list &#39;ac-dictionary-directories &quot;/root/.emacs.d/auto-complete/ac-dict&quot;)</div>
<div>
		(ac-config-default)</div>
</blockquote>
<p>上面的路径就是和刚才的安装路径，如果你和我安装的路径不一样，请把它改成你自己的路径。<br />
<span style="color:#0000ff;">The paths above are just the installation directory, if yours are different from mine, change them.</span><br />
<span style="color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a><br />
<span style="background-color:#00ffff;">②</span>安装clang <span style="color:#ff0000;">/</span> <span style="color:#0000ff;">Install clang</span><br />
用pacman安装clang是最方便的：<br />
<span style="color:#0000ff;">Using pacman to install clang is the most&nbsp;convenient way:</span></p>
<pre style="margin-top: 0px; margin-bottom: 0px; font-stretch: normal; font-size: 0.9333em; line-height: 1.5em; font-family: Consolas, &quot;Lucida Console&quot;, &quot;DejaVu Sans Mono&quot;, Monaco, &quot;Courier New&quot;, monospace; background: rgb(0, 34, 64); color: rgb(255, 255, 255);">
pacman -S clang</pre>
<p>如果你不幸遇到了下面的错误：<br />
<span style="color:#0000ff;">If you get the following errors&nbsp;unfortunately:</span></p>
<blockquote>
<div>
		error: failed retrieving file &#39;llvm-3.1-4-armv6h.pkg.tar.xz&#39; from mirror.archlinuxarm.org : The requested URL returned error: 404</div>
<div>
		warning: failed to retrieve some files from extra</div>
<div>
		error: failed retrieving file &#39;clang-3.1-4-armv6h.pkg.tar.xz&#39; from mirror.archlinuxarm.org : The requested URL returned error: 404</div>
<div>
		warning: failed to retrieve some files from extra</div>
<div>
		error: failed to commit transaction (download library error)</div>
</blockquote>
<div>
	那么你可以选择升级系统：<br />
	<span style="color:#0000ff;">Then you can choose to update the system:</span></div>
<pre style="margin-top: 0px; margin-bottom: 0px; font-stretch: normal; font-size: 0.9333em; line-height: 1.5em; font-family: Consolas, &quot;Lucida Console&quot;, &quot;DejaVu Sans Mono&quot;, Monaco, &quot;Courier New&quot;, monospace; background: rgb(0, 34, 64); color: rgb(255, 255, 255);">
pacman -Syu</pre>
<p>然后再用pacman安装clang，应该就没有上面的问题了。<br />
<span style="color:#0000ff;">Then install clang again, and the errors should not occur.</span><br />
<span style="background-color:#00ffff;">③</span>安装auto-complete-clang <span style="color:#ff0000;">/</span> <span style="color:#0000ff;">Install&nbsp;auto-complete-clang</span><br />
其实这一步所谓的安装，不过是下载+配置，并没有像上面一样的编译过程。<br />
<span style="color:#0000ff;">Actually the so-called installation in this step is just a process of downloading &amp; configuration, there is no compilation as previous steps.</span><br />
下载配置文件auto-complete-clang.el，我把它放到了 .emacs.d/auto-complete-clang 目录下。<br />
<span style="color:#0000ff;">Download the configuration file&nbsp;auto-complete-clang.el and I put it to directory&nbsp;.emacs.d/auto-complete-clang .</span><br />
在.emacs中添加下面一句：<br />
<span style="color:#0000ff;">Add the following line in Emacs configuration file .emacs:</span></p>
<blockquote>
<p>
		(add-to-list &#39;load-path &quot;~/.emacs.d/auto-complete-clang&quot;)</p>
</blockquote>
<p>该目录就是你放置&nbsp;auto-complete-clang.el 文件的目录。<br />
<span style="color:#0000ff;">The directory is just where you put file&nbsp;auto-complete-clang.el into.</span><br />
然后再继续添加如下内容（从网上抄来的）：<br />
<span style="color:#0000ff;">Then continue to add following content(I got this from the Internet):</span></p>
<blockquote>
<div>
		(require &#39;auto-complete-clang)</div>
<div>
		(setq ac-auto-start t)</div>
<div>
		(setq ac-quick-help-delay 0.5)</div>
<div>
		;; (ac-set-trigger-key &quot;TAB&quot;)</div>
<div>
		;; (define-key ac-mode-map&nbsp; [(control tab)] &#39;auto-complete)</div>
<div>
		(define-key ac-mode-map&nbsp; [(control tab)] &#39;auto-complete)</div>
<div>
		(defun my-ac-config ()</div>
<div>
		&nbsp; (setq ac-clang-flags</div>
<div>
		&nbsp; &nbsp; &nbsp; &nbsp; (mapcar(lambda (item)(concat &quot;-I&quot; item))</div>
<div>
		&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(split-string</div>
<div>
		&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;</div>
<div>
		&nbsp;/usr/lib/gcc/armv6l-unknown-linux-gnueabihf/4.7.2/../../../../include/c++/4.7.2</div>
<div>
		&nbsp;/usr/lib/gcc/armv6l-unknown-linux-gnueabihf/4.7.2/../../../../include/c++/4.7.2/armv6l-unknown-linux-gnueabihf</div>
<div>
		&nbsp;/usr/lib/gcc/armv6l-unknown-linux-gnueabihf/4.7.2/../../../../include/c++/4.7.2/backward</div>
<div>
		&nbsp;/usr/lib/gcc/armv6l-unknown-linux-gnueabihf/4.7.2/include</div>
<div>
		&nbsp;/usr/local/include</div>
<div>
		&nbsp;/usr/lib/gcc/armv6l-unknown-linux-gnueabihf/4.7.2/include-fixed</div>
<div>
		&nbsp;/usr/include</div>
<div>
		&quot;)))</div>
<div>
		&nbsp; (setq-default ac-sources &#39;(ac-source-abbrev ac-source-dictionary ac-source-words-in-same-mode-buffers))</div>
<div>
		&nbsp; (add-hook &#39;emacs-lisp-mode-hook &#39;ac-emacs-lisp-mode-setup)</div>
<div>
		&nbsp; ;; (add-hook &#39;c-mode-common-hook &#39;ac-cc-mode-setup)</div>
<div>
		&nbsp; (add-hook &#39;ruby-mode-hook &#39;ac-ruby-mode-setup)</div>
<div>
		&nbsp; (add-hook &#39;css-mode-hook &#39;ac-css-mode-setup)</div>
<div>
		&nbsp; (add-hook &#39;auto-complete-mode-hook &#39;ac-common-setup)</div>
<div>
		&nbsp; (global-auto-complete-mode t))</div>
<div>
		(defun my-ac-cc-mode-setup ()</div>
<div>
		&nbsp; (setq ac-sources (append &#39;(ac-source-clang ac-source-yasnippet) ac-sources)))</div>
<div>
		(add-hook &#39;c-mode-common-hook &#39;my-ac-cc-mode-setup)</div>
<div>
		;; ac-source-gtags</div>
<div>
		(my-ac-config)</div>
</blockquote>
<div>
	其中，那些类似于 <span style="color:#0000ff;">/usr/XXX</span> 的路径因环境不同而不同，它是通过如下命令得知的：<br />
	<span style="color:#0000ff;">The directories like&nbsp;</span><span style="color:#ff0000;">/usr/XXX</span><span style="color:#0000ff;"> are vary from&nbsp;environment to&nbsp;environment, they can be obtained via following command:</span></div>
<pre style="margin-top: 0px; margin-bottom: 0px; font-stretch: normal; font-size: 0.9333em; line-height: 1.5em; font-family: Consolas, &quot;Lucida Console&quot;, &quot;DejaVu Sans Mono&quot;, Monaco, &quot;Courier New&quot;, monospace; background: rgb(0, 34, 64); color: rgb(255, 255, 255);">
<span style="color: rgb(255, 176, 84);">echo</span> <span style="color: rgb(58, 217, 0);">&quot;</span><span style="color: rgb(58, 217, 0);">&quot;</span> <span style="color: rgb(255, 157, 0);">|</span> g++ -v -x c++ -E -</pre>
<div>
	从输出的一大堆信息中，找到那些 /usr/XXX 的路径填上就可以了。<br />
	<span style="color:#0000ff;">You can find the /usr/XXX paths from the messages outputted by the command.</span></div>
<div>
	配置好之后，再用Emacs打开一个C++代码文件，看看自动完成是不是生效了？<br />
	<span style="color:#0000ff;">After all these are done, open a C++ source file with Emacs to check whether the auto-completion has been available for you.</span></div>
<p><span style="color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a><br />
<span style="background-color: rgb(0, 255, 0); ">【7】</span>设置终端文字颜色 <span style="color:#ff0000;">/</span> <span style="color:#0000ff;">Setup the terminal text color</span><br />
Arch Linux ARM默认情况下终端文字是黑白的，对于文件和目录类型不方便区分，为提高工作效率，需要其显示不同颜色。<br />
<span style="color:#0000ff;">By default the Arch Linux ARM terminal text colors are just black and white and it&#39;s not&nbsp;convenient to identify directories &amp; files. So in order to improve the work efficiency we should setup the text color.</span><br />
修改&nbsp;<span style="color:#0000ff;">/etc/profile</span>，在最后添加一行：<br />
<span style="color:#0000ff;">Edit </span><span style="color:#ff0000;">/etc/profile</span><span style="color:#0000ff;"> and add the following line:</span></p>
<pre style="margin-top: 0px; margin-bottom: 0px; font-stretch: normal; font-size: 0.9333em; line-height: 1.5em; font-family: Consolas, &quot;Lucida Console&quot;, &quot;DejaVu Sans Mono&quot;, Monaco, &quot;Courier New&quot;, monospace; background: rgb(0, 34, 64); color: rgb(255, 255, 255);">
<span style="color: rgb(255, 176, 84);">alias</span> ls=<span style="color: rgb(58, 217, 0);">&quot;</span>ls --color=auto<span style="color: rgb(58, 217, 0);">&quot;</span></pre>
<p>这样，ls命令显示出来的文字就有不同颜色了。<br />
<span style="color:#0000ff;">Then the &quot;ls&quot; command will display the colorful text.</span></p>
<p><span style="background-color: rgb(0, 255, 0); ">【8】</span>Arch Linux ARM的rontab文件在哪里 / Where the crontab file is<br />
使用 <span style="color:#b22222;">crontab -e</span> 命令可以编辑当前用户的crontab配置文件，但这个文件是位于何处？我更喜欢直接编辑它，因为我可以用我习惯的Emacs来操作。它是在&nbsp;<span style="color:#b22222;">/var/spool/cron/</span> 目录下，用户名即为文件名，例如，root用户的 <span style="color:#b22222;">crontab -e</span> 命令编辑的就是&nbsp;<span style="color:#b22222;">/var/spool/cron/root</span> 文件。<br />
<span style="color:#0000ff;">We can use command </span><span style="color:#b22222;">crontab -e</span><span style="color:#0000ff;"> to edit the crontab configuration file of current user, so where the corresponding file is? I like more to edit the file directly, because I can use my favourite editor Emacs to edit it. The crontab file is under the directory </span><span style="color:#b22222;">/var/spool/cron/</span><span style="color:#0000ff;"> , and with the same name as the Linux user, for example, the command </span><span style="color:#b22222;">crontab -e</span><span style="color:#0000ff;"> ran by root user will edit the file </span><span style="color:#b22222;">/var/spool/cron/root</span><span style="color:#0000ff;"> .</span></p>
<p><span style="background-color: rgb(0, 255, 0); ">【9】</span>安装dig，nslookup程序 / <span style="color:#0000ff;">Install command dig &amp; nslookup</span><br />
dig和nslookup程序包含在dnsutils包中，所以这样安装：<br />
<span style="color:#0000ff;">dig &amp; nslookup are contained in package&nbsp;dnsutils, so you can install them by:</span></p>
<pre style="margin-top: 0px; margin-bottom: 0px; font-stretch: normal; font-size: 0.9333em; line-height: 1.5em; font-family: Consolas, &quot;Lucida Console&quot;, &quot;DejaVu Sans Mono&quot;, Monaco, &quot;Courier New&quot;, monospace; background: rgb(0, 34, 64); color: rgb(255, 255, 255);">
pacman -S dnsutils</pre>
<p>如果你用 pacman -S dig 或 pacman -S nslookup 来找，是找死也找不到的。<br />
<span style="color:#0000ff;">If you use pacman -S dig or pacmsn -S nslookup to install them, you&#39;ll never get what you want.</span><br />
<span style="color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a><br />
<span style="background-color: rgb(0, 255, 0); ">【10】</span>备份SD卡上的系统 / <span style="color:#0000ff;">Backup the OS on SD card</span><br />
万一SD卡损坏，你辛辛苦苦配置了很久的系统就没了，所以必须要备份。直接拷贝SD卡里的数据到另一张SD卡上是行不通的，可以通过Linux的dd命令来复制SD卡，非常方便。<br />
<span style="color:#0000ff;">If the SD card broken, you&#39;ll lose the OS that you&#39;ve spent weeks on it, so it&#39;s very necessary to backup it. It&#39;s impossible to backup the OS by simply copying the SD card files to another card, you can do this by Linux command dd.</span><br />
<span style="background-color:#dda0dd;">（A）</span>查看SD卡的设备名 / <span style="color:#0000ff;">Check the device name of the SD card</span></p>
<pre style="margin-top: 0px; margin-bottom: 0px; font-stretch: normal; font-size: 0.9333em; line-height: 1.5em; font-family: Consolas, &quot;Lucida Console&quot;, &quot;DejaVu Sans Mono&quot;, Monaco, &quot;Courier New&quot;, monospace; background: rgb(0, 34, 64); color: rgb(255, 255, 255);">
[codelast@ <span style="color: rgb(255, 157, 0);">~</span>]$ dmesg <span style="color: rgb(255, 157, 0);">|</span> tail
[487324.668042] sd 7:0:0:0: [sdb] Mode Sense: 03 00 00 00
[487324.668916] sd 7:0:0:0: [sdb] No Caching mode page present
[487324.668922] sd 7:0:0:0: [sdb] Assuming drive cache: write through
[487324.672481] sd 7:0:0:0: [sdb] No Caching mode page present
[487324.672487] sd 7:0:0:0: [sdb] Assuming drive cache: write through
[487324.674866]  sdb: sdb1 sdb2 sdb3
[487324.679206] sd 7:0:0:0: [sdb] No Caching mode page present
[487324.679213] sd 7:0:0:0: [sdb] Assuming drive cache: write through
[487324.679218] sd 7:0:0:0: [sdb] Attached SCSI removable disk
[487325.617680] pool[9188]: segfault at 0 ip 000000000042e62d sp 00007f88ff2c4520 error 4 <span style="color: rgb(255, 157, 0);">in</span> udisksd[400000+45000]</pre>
<p>可见我的SD卡设备名是sdb。<br />
<span style="color:#0000ff;">You can see that my SD card device name is sdb.</span><br />
<span style="background-color:#dda0dd;">（B）</span>备份SD卡上的OS到一个磁盘文件里 / <span style="color:#0000ff;">Backup the OS on SD card to a disk file</span></p>
<pre style="margin-top: 0px; margin-bottom: 0px; font-stretch: normal; font-size: 0.9333em; line-height: 1.5em; font-family: Consolas, &quot;Lucida Console&quot;, &quot;DejaVu Sans Mono&quot;, Monaco, &quot;Courier New&quot;, monospace; background: rgb(0, 34, 64); color: rgb(255, 255, 255);">
[codelast@ <span style="color: rgb(255, 157, 0);">~</span>]$ sudo dd <span style="color: rgb(255, 157, 0);">if</span>=/dev/sdb of=<span style="color: rgb(255, 157, 0);">~</span>/raspberry_pi_os_backup
31537152+0 records <span style="color: rgb(255, 157, 0);">in</span>
31537152+0 records out
16147021824 bytes <span style="color: rgb(225, 239, 255);">(</span>16 GB<span style="color: rgb(225, 239, 255);">)</span> copied, 942.766 s, 17.1 MB/s</pre>
<p>在这里，/dev/sdb是我的SD卡，OS被备份到了~/raspberry_pi_os_backup文件中。整个过程花了约15分钟完成（16G的SD卡）。<br />
<span style="color:#0000ff;">So /dev/sdb is my SD card and the OS was backuped to file ~/raspberry_pi_os_backup. The whole process took me about 15 minutes(16GB SD card).</span><br />
<span style="color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a><br />
<span style="background-color: rgb(221, 160, 221); ">（C）</span>将格式化新的SD卡为ext4 / <span style="color:#0000ff;">Format the new SD card to ext4</span><br />
由于我原来的SD卡是ext4格式，所以我利用Ubuntu的磁盘管理工具将新的SD卡也格式化成了ext4格式。至于这一步是否有必要，我没有试验，但是可以肯定的是：这样做一定能成功。<br />
<span style="color:#0000ff;">Because my old SD card has a format of ext4, so I used the Ubuntu disk management tool to format the new SD card to ext4, too. I&#39;m not sure whether this step is a must, but I&#39;m sure that it&#39;s no problem to do this and can lead you to success.</span><br />
<span style="background-color:#dda0dd;">（D）</span>将备份的磁盘文件恢复到新的SD卡上 / <span style="color:#0000ff;">Restore the disk file to the new SD card</span><br />
<span style="color:#ff0000;">拔下旧的SD卡，插上新的SD卡</span>，用 dmesg | tail&nbsp;命令查看一下，新的SD卡的设备名仍然是sdb，因此恢复OS的命令为：<br />
<span style="color:#0000ff;">Unplug the old SD card, plug the new SD card into your computer, and use dmesg | tail command to check the device name(it&#39;s still sdb), so the command to restore the OS is:</span></p>
<pre style="margin-top: 0px; margin-bottom: 0px; font-stretch: normal; font-size: 0.9333em; line-height: 1.5em; font-family: Consolas, &quot;Lucida Console&quot;, &quot;DejaVu Sans Mono&quot;, Monaco, &quot;Courier New&quot;, monospace; background: rgb(0, 34, 64); color: rgb(255, 255, 255);">
[codelast@ <span style="color: rgb(255, 157, 0);">~</span>]$ sudo dd <span style="color: rgb(255, 157, 0);">if</span>=<span style="color: rgb(255, 157, 0);">~</span>/raspberry_pi_os_backup of=/dev/sdb
31537152+0 records <span style="color: rgb(255, 157, 0);">in</span>
31537152+0 records out
16147021824 bytes <span style="color: rgb(225, 239, 255);">(</span>16 GB<span style="color: rgb(225, 239, 255);">)</span> copied, 5459.12 s, 3.0 MB/s</pre>
<p>这个操作时间更长，耐心等待完成即可。<br />
<span style="color:#0000ff;">This process takes even more time, just be patient and wait it to finish.</span><br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255);">http://www.codelast.com/</span></a><br />
<span style="background-color: rgb(0, 255, 0);">【11】</span>用pacman -Syu升级系统时提示&ldquo;error: failed to commit transaction (conflicting files)&rdquo;的解决办法 / <span style="color:#0000ff;">How to fix the &quot;error: failed to commit transaction (conflicting files)&quot; problem when using [pacman -Syu] to upgrade your OS</span><br />
我在用pacman -Syu升级系统时，提示如下错误：<br />
<span style="color:#0000ff;">When I used &quot;pacman -Syu&quot; to upgrade my OS, I got these error messages:</span></p>
<blockquote>
<div>
		error: failed to commit transaction (conflicting files)</div>
<div>
		filesystem: /bin exists in filesystem</div>
<div>
		filesystem: /sbin exists in filesystem</div>
<div>
		filesystem: /usr/sbin exists in filesystem</div>
<div>
		Errors occurred, no packages were upgraded.</div>
</blockquote>
<p>这个问题可以通过依次执行以下几条命令来解决，经测试可用：<br />
<span style="color:#0000ff;">To solve the problem, you can execute following commands one by one and they worked for me:</span></p>
<pre style="margin-top: 0px; margin-bottom: 0px; font-stretch: normal; font-size: 0.9333em; line-height: 1.5em; font-family: Consolas, &quot;Lucida Console&quot;, &quot;DejaVu Sans Mono&quot;, Monaco, &quot;Courier New&quot;, monospace; background: rgb(0, 34, 64); color: rgb(255, 255, 255);">
pacman -R localepurge
pacman -Syu --ignore filesystem,bash
pacman -S bash
pacman -Su</pre>
<p><span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255);">http://www.codelast.com/</span></a><br />
<span style="background-color: rgb(0, 255, 0);">【12】</span>清空pacman安装包缓存<br />
某天我用 pacman -Syu 升级OS的时候，提示空间不足，我当时觉得不可思议，因为我在SD卡上存储的东西并不多，于是我用 du -sh 把系统目录挨个看了一下，发现占用空间最大的是&nbsp;<span style="color:#0000ff;">/var/cache/pacman/pkg</span> 这个目录，足足占了我3.5GB！从名字上看，它应该是用 pacman 安装软件时留下的缓存，应该是可以清掉的，于是Google了一下，找到答案：可以用下面的命令清除掉一些旧的缓存：</p>
<blockquote>
<p>
		pacman -Sc</p>
</blockquote>
<p>如果要清除全部缓存，则可以用下面的命令：</p>
<blockquote>
<p>
		pacman -Scc</p>
</blockquote>
<p>我使用的是前者，执行完后释放了2.8GB的空间，又可以愉快地玩耍了。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255);">http://www.codelast.com/</span></a><br />
<span style="background-color: rgb(0, 255, 0);">【13】</span>创建用户 &amp; 免密码切换到root<br />
新装好的系统创建用户：</p>
<blockquote>
<p>
		useradd -m codelast</p>
</blockquote>
<p>这就创建了一个codelast用户。-m表示在 /home/ 目录下创建一个 codelast 目录，如果不加此参加则不创建。<br />
之后紧接着就修改codelast用户的密码：</p>
<blockquote>
<p>
		passwd codelast</p>
</blockquote>
<p>再之后，为这个用户设置免密码切换到root的权限：</p>
<blockquote>
<p>
		visudo</p>
</blockquote>
<p>这会自动用一个编辑器打开 /etc/sudoers 文件（注意不能用其他的编辑器来编辑此文件，但这个默认的编辑器太难用了）。<br />
在文件中加上这一句：</p>
<pre style="user-select: text; position: absolute; top: -99px;">
codelast ALL=(ALL) NOPASSWD: ALL
</pre>
<blockquote>
<p>
		codelast ALL=(ALL) NOPASSWD: ALL</p>
</blockquote>
<p>表示允许codelast用户免密码执行任何命令。无需重启，保存文件之后用 codelast 用户试一下：</p>
<blockquote>
<p>
		sudo su -</p>
</blockquote>
<p>应该就能免密码切换到root了</p>
<p><span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;版权声明&nbsp;<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;<br />
转载需注明出处：<u><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><em><span style="color: rgb(0, 0, 255);"><strong style="font-size: 16px;"><span style="font-family: arial, helvetica, sans-serif;">codelast.com</span></strong></span></em></a></u>&nbsp;<br />
感谢关注我的微信公众号（微信扫一扫）：</p>
<p style="border: 0px; font-size: 13px; margin: 0px 0px 9px; outline: 0px; padding: 0px; color: rgb(77, 77, 77);">
	<img decoding="async" alt="wechat qrcode of codelast" src="https://www.codelast.com/codelast_wechat_qr_code.jpg" style="width: 200px; height: 200px;" /></p>
<div id="KSFIND_MASK" style="background-color: rgb(0, 0, 0); opacity: 0.22; position: absolute !important; left: 0px !important; top: 0px !important; border: 0px none !important; padding: 0px !important; z-index: 1000000 !important; height: 0px; width: 0px; display: none; cursor: auto; ">
	&nbsp;</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codelast.com/%e5%8e%9f%e5%88%9braspberry-pi%e6%a0%91%e8%8e%93%e6%b4%be%e9%85%8d%e7%bd%ae%e8%ae%b0%e5%bd%95configure-the-arch-linux-arm-on-raspberry-pi/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
			</item>
		<item>
		<title>[原创]使用C++（通过Thrift）访问/操作/读写Hbase</title>
		<link>https://www.codelast.com/%e5%8e%9f%e5%88%9b%e4%bd%bf%e7%94%a8c%ef%bc%88%e9%80%9a%e8%bf%87thrift%ef%bc%89%e8%ae%bf%e9%97%aehbase/</link>
					<comments>https://www.codelast.com/%e5%8e%9f%e5%88%9b%e4%bd%bf%e7%94%a8c%ef%bc%88%e9%80%9a%e8%bf%87thrift%ef%bc%89%e8%ae%bf%e9%97%aehbase/#comments</comments>
		
		<dc:creator><![CDATA[learnhard]]></dc:creator>
		<pubDate>Thu, 01 Sep 2011 05:40:43 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Boost]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[client]]></category>
		<category><![CDATA[connect]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[Hbase]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[libevent]]></category>
		<category><![CDATA[operate]]></category>
		<category><![CDATA[read]]></category>
		<category><![CDATA[sample]]></category>
		<category><![CDATA[Thrift]]></category>
		<category><![CDATA[write]]></category>
		<category><![CDATA[例子]]></category>
		<category><![CDATA[操作Hbase]]></category>
		<category><![CDATA[教程]]></category>
		<category><![CDATA[方法]]></category>
		<category><![CDATA[示例]]></category>
		<category><![CDATA[访问]]></category>
		<category><![CDATA[访问Hbase]]></category>
		<category><![CDATA[读写]]></category>
		<category><![CDATA[读写HBase]]></category>
		<category><![CDATA[读取]]></category>
		<guid isPermaLink="false">http://www.codelast.com/?p=3303</guid>

					<description><![CDATA[<p>
	<span style="font-family: 宋体; font-size: 14px;">无奈，网上关于C++访问Hbase的文章实在太少，所以只好自己折腾一下，然后写出来了。</span></p>
<p>
	<span style="color: #000000;"><span style="font-size: 14px;"><span style="font-family: 宋体;">要使用C++访问Hbase，可以走的途径少之又少，据说当前最好的方法就是通过Thrift来实现：</span></span></span><span style="font-size: 14px;"><span style="font-family: 宋体;"><a href="http://thrift.apache.org/" target="_blank" rel="noopener noreferrer"><span style="color: #000000;">http://thrift.apache.org/</span></a></span></span></p>
<p>
	<span style="color: #000000;"><span style="font-size: 14px;"><span style="font-family: 宋体;">所以本文分成几部分：（1）安装Thrift；（2）用Thrift 生成访问Hbase所需的C++文件；（3）在程序中通过Thrift来访问Hbase。</span></span></span></p>
<p>
	<span style="color: #000000;"><span style="font-size: 14px;"><span style="font-family: 宋体;">另外，本文只包含读写Hbase数据的例子，不包含配置Hbase的方法，如需这些内容，请自行搜索。</span></span></span></p>
<p>
	<span style="color: #000000;"><span style="font-size: 14px;"><span style="font-family: 宋体;">首先声明一下，本文基于以下环境：<br />
	<span id="more-3303"></span><!--more--><!--more--><!--more--><!--more--><!--more--><!--more--></span></span></span></p>
<p>
	<span style="color: #000000;"><span style="font-size: 14px;"><span style="font-family: 宋体;">操作系统：RHEL 5.3，64位</span></span></span></p>
<p>
	<span style="color: #000000;"><span style="font-size: 14px;"><span style="font-family: 宋体;">Thrift 版本：0.7.0</span></span></span></p>
<p>
	<span style="color: #000000;"><span style="font-size: 14px;"><span style="font-family: 宋体;">要访问的 Hbase 版本：0.20.6</span></span></span></p>
<p>
	<span style="color: #000000;"><span style="font-size: 14px;"><span style="font-family: 宋体;">我使用0.90.4的 Hbase 安装包来生成C++所需的Hbase.h等文件（用新版的应该能兼容旧版的）</span></span></span></p>
<p>
	<span style="color: rgb(255, 255, 255); font-family: arial, helvetica, sans-serif; font-size: 14px; line-height: 20px; text-align: left; background-color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a></p>
<p>
	<span style="color: #000000;"><span style="font-size: 14px;"><span style="font-family: 宋体;">下面开始，一步步来。</span></span></span></p>
<p>
	<span style="color: #000000;"><span style="font-size: 14px;"><span style="font-family: 宋体;">（1）安装Thrift</span></span></span></p>
<p>
	<span style="color: #000000;"><span style="font-size: 14px;"><span style="font-family: 宋体;">不是一件很轻松的事。如果你的系统比较干净，可能很顺利地就搞定了，如果有依赖库缺失问题或者库冲突问题，那么就只能根据具体情况，一个个问题去fix了，谁知道会有多少麻烦。</span></span></span></p>
<p>
	<span style="color: #000000;"><span style="font-size: 14px;"><span style="font-family: 宋体;">我运气比较好，在一个干净的系统上，很快就完成了。</span></span></span></p>
<p>
	<span style="color: #000000;"><span style="font-size: 14px;"><span style="font-family: 宋体;">Thrift 至少会依赖于两个系统中一般不会带的库：libevent，boost。</span></span></span></p>
<p>
	<span style="color: #000000;"><span style="font-size: 14px;"><span style="font-family: 宋体;">libevent 到这里下载：</span></span></span><span style="font-size: 14px;"><span style="font-family: 宋体;"><a href="http://monkey.org/~provos/libevent/" target="_blank" rel="noopener noreferrer"><span style="color: #000000;">http://monkey.org/~provos/libevent/</span></a></span></span><span style="color: #000000;"><span style="font-size: 14px;"><span style="font-family: 宋体;">&#160; 我使用的版本是：2.0.12-stable</span></span></span></p>
<p>
	<span style="color: #000000;"><span style="font-size: 14px;"><span style="font-family: 宋体;">boost 到这里下载：</span></span></span><span style="font-size: 14px;"><span style="font-family: 宋体;"><a href="http://www.boost.org/" target="_blank" rel="noopener noreferrer"><span style="color: #000000;">http://www.boost.org/</span></a></span></span><span style="color: #000000;"><span style="font-size: 14px;"><span style="font-family: 宋体;">&#160; 我使用的版本是：1.47.0</span></span></span></p>
<p>
	<span style="color: rgb(255, 255, 255); font-family: arial, helvetica, sans-serif; font-size: 14px; line-height: 20px; text-align: left; background-color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a></p>
<p>
	<span style="font-size: 14px;"><span style="font-family: 宋体;">安装libevent：</span></span></p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
./configure --prefix=/usr/local/libevent
make
make install</pre>
<p>
	<span style="font-size: 14px;"><span style="font-family: 宋体;">安装boost（boost不像一般的Linux源码安装包一样，它的安装不是configure，make，make install，有点怪）：</span></span></p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
./bootstrap.sh</pre>&#8230; <a href="https://www.codelast.com/%e5%8e%9f%e5%88%9b%e4%bd%bf%e7%94%a8c%ef%bc%88%e9%80%9a%e8%bf%87thrift%ef%bc%89%e8%ae%bf%e9%97%aehbase/" class="read-more">Read More </a>]]></description>
										<content:encoded><![CDATA[<p>
	<span style="font-family: 宋体; font-size: 14px;">无奈，网上关于C++访问Hbase的文章实在太少，所以只好自己折腾一下，然后写出来了。</span></p>
<p>
	<span style="color: #000000;"><span style="font-size: 14px;"><span style="font-family: 宋体;">要使用C++访问Hbase，可以走的途径少之又少，据说当前最好的方法就是通过Thrift来实现：</span></span></span><span style="font-size: 14px;"><span style="font-family: 宋体;"><a href="http://thrift.apache.org/" target="_blank" rel="noopener noreferrer"><span style="color: #000000;">http://thrift.apache.org/</span></a></span></span></p>
<p>
	<span style="color: #000000;"><span style="font-size: 14px;"><span style="font-family: 宋体;">所以本文分成几部分：（1）安装Thrift；（2）用Thrift 生成访问Hbase所需的C++文件；（3）在程序中通过Thrift来访问Hbase。</span></span></span></p>
<p>
	<span style="color: #000000;"><span style="font-size: 14px;"><span style="font-family: 宋体;">另外，本文只包含读写Hbase数据的例子，不包含配置Hbase的方法，如需这些内容，请自行搜索。</span></span></span></p>
<p>
	<span style="color: #000000;"><span style="font-size: 14px;"><span style="font-family: 宋体;">首先声明一下，本文基于以下环境：<br />
	<span id="more-3303"></span><!--more--><!--more--><!--more--><!--more--><!--more--><!--more--></span></span></span></p>
<p>
	<span style="color: #000000;"><span style="font-size: 14px;"><span style="font-family: 宋体;">操作系统：RHEL 5.3，64位</span></span></span></p>
<p>
	<span style="color: #000000;"><span style="font-size: 14px;"><span style="font-family: 宋体;">Thrift 版本：0.7.0</span></span></span></p>
<p>
	<span style="color: #000000;"><span style="font-size: 14px;"><span style="font-family: 宋体;">要访问的 Hbase 版本：0.20.6</span></span></span></p>
<p>
	<span style="color: #000000;"><span style="font-size: 14px;"><span style="font-family: 宋体;">我使用0.90.4的 Hbase 安装包来生成C++所需的Hbase.h等文件（用新版的应该能兼容旧版的）</span></span></span></p>
<p>
	<span style="color: rgb(255, 255, 255); font-family: arial, helvetica, sans-serif; font-size: 14px; line-height: 20px; text-align: left; background-color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a></p>
<p>
	<span style="color: #000000;"><span style="font-size: 14px;"><span style="font-family: 宋体;">下面开始，一步步来。</span></span></span></p>
<p>
	<span style="color: #000000;"><span style="font-size: 14px;"><span style="font-family: 宋体;">（1）安装Thrift</span></span></span></p>
<p>
	<span style="color: #000000;"><span style="font-size: 14px;"><span style="font-family: 宋体;">不是一件很轻松的事。如果你的系统比较干净，可能很顺利地就搞定了，如果有依赖库缺失问题或者库冲突问题，那么就只能根据具体情况，一个个问题去fix了，谁知道会有多少麻烦。</span></span></span></p>
<p>
	<span style="color: #000000;"><span style="font-size: 14px;"><span style="font-family: 宋体;">我运气比较好，在一个干净的系统上，很快就完成了。</span></span></span></p>
<p>
	<span style="color: #000000;"><span style="font-size: 14px;"><span style="font-family: 宋体;">Thrift 至少会依赖于两个系统中一般不会带的库：libevent，boost。</span></span></span></p>
<p>
	<span style="color: #000000;"><span style="font-size: 14px;"><span style="font-family: 宋体;">libevent 到这里下载：</span></span></span><span style="font-size: 14px;"><span style="font-family: 宋体;"><a href="http://monkey.org/~provos/libevent/" target="_blank" rel="noopener noreferrer"><span style="color: #000000;">http://monkey.org/~provos/libevent/</span></a></span></span><span style="color: #000000;"><span style="font-size: 14px;"><span style="font-family: 宋体;">&nbsp; 我使用的版本是：2.0.12-stable</span></span></span></p>
<p>
	<span style="color: #000000;"><span style="font-size: 14px;"><span style="font-family: 宋体;">boost 到这里下载：</span></span></span><span style="font-size: 14px;"><span style="font-family: 宋体;"><a href="http://www.boost.org/" target="_blank" rel="noopener noreferrer"><span style="color: #000000;">http://www.boost.org/</span></a></span></span><span style="color: #000000;"><span style="font-size: 14px;"><span style="font-family: 宋体;">&nbsp; 我使用的版本是：1.47.0</span></span></span></p>
<p>
	<span style="color: rgb(255, 255, 255); font-family: arial, helvetica, sans-serif; font-size: 14px; line-height: 20px; text-align: left; background-color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a></p>
<p>
	<span style="font-size: 14px;"><span style="font-family: 宋体;">安装libevent：</span></span></p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
./configure --prefix=/usr/local/libevent
make
make install</pre>
<p>
	<span style="font-size: 14px;"><span style="font-family: 宋体;">安装boost（boost不像一般的Linux源码安装包一样，它的安装不是configure，make，make install，有点怪）：</span></span></p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
./bootstrap.sh --prefix=/usr/local/boost</pre>
<p>
	<span style="font-size: 14px;"><span style="font-family: 宋体;">不出错的话接着执行以下命令开始编译（也可以通过编辑project-config.jam文件调整编译参数）：</span></span></p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
./b2
./b2 install</pre>
<p>
	<span style="font-size: 14px;"><span style="font-family: 宋体;">安装Thrift：</span></span></p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
chmod +x configure
./configure --with-boost=/usr/local --prefix=/usr/local/thrift
make
make install</pre>
<p>
	<span style="font-size: 14px;"><span style="font-family: 宋体;">至此，安装Thrift 的工作就完成了。</span></span></p>
<p>
	<span style="color: rgb(255, 255, 255); font-family: arial, helvetica, sans-serif; font-size: 14px; line-height: 20px; text-align: left; background-color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a></p>
<p>
	<span style="font-size: 14px;"><span style="font-family: 宋体;">（2）用Thrift 生成访问Hbase所需的C++文件</span></span></p>
<p>
	<span style="font-size: 14px;"><span style="font-family: 宋体;">访问Hbase需要在你的程序中使用若干.h，.cpp文件，这些文件是用 Thrift 生成的。</span></span></p>
<p>
	<span style="font-size: 14px;"><span style="font-family: 宋体;">解压Hbase源码安装包：</span></span></p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
tar zxf hbase-0.90.4.tar.gz
cd hbase-0.90.4</pre>
<p>
	<span style="font-size: 14px;"><span style="font-family: 宋体;">在解压出来的文件中， 你可以找到一个名为 Hbase.thrift 的文件，这个文件定义了如何通过 Thrift 接口来访问Hbase。用这个Thrift文件，可以生成访问Hbase所需的C++文件：</span></span></p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
/usr/local/thrift/bin/thrift --gen cpp ./src/main/resources/org/apache/hadoop/hbase/thrift/Hbase.thrift</pre>
<p>
	<span style="font-size: 14px;"><span style="font-family: 宋体;">会发现生成了gen-cpp目录：</span></span></p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
ls gen-cpp/</pre>
<p>
	<span style="font-size: 14px;"><span style="font-family: 宋体;">输出：</span></span></p>
<p>
	<span style="font-size: 14px;"><span style="font-family: 宋体;"><span style="color: #0000ff;">Hbase_constants.cpp &nbsp;Hbase_constants.h &nbsp;Hbase.cpp &nbsp;Hbase.h &nbsp;Hbase_server.skeleton.cpp &nbsp;Hbase_types.cpp &nbsp;Hbase_types.h</span></span></span></p>
<p>
	<span style="font-size: 14px;"><span style="font-family: 宋体;">除了Hbase_server.skeleton.cpp之外，其余文件都是在我们的程序里要用到的，将它们拷贝到我们的工程目录下。</span></span></p>
<p>
	<span style="color: rgb(255, 255, 255); font-family: arial, helvetica, sans-serif; font-size: 14px; line-height: 20px; text-align: left; background-color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a></p>
<p>
	<span style="font-size: 14px;"><span style="font-family: 宋体;">（3）在程序中使用Thrift来访问Hbase</span></span></p>
<p>
	<span style="font-size: 14px;"><span style="font-family: 宋体;">要能通过 Thrift 访问Hbase，你必须首先要打开HBase的 Thrift 服务，请参考其他文档确保这一点是可用的。</span></span></p>
<p>
	<span style="font-size: 14px;"><span style="font-family: 宋体;">下一步，我们在程序中如何读取Hbase的数据？</span></span></p>
<p>
	<span style="font-size: 14px;"><span style="font-family: 宋体;">我们先看看hbase源码安装包中自带的例子：在解压出来的安装包中的&nbsp;examples/thrift/ 目录下的&nbsp;DemoClient.cpp 文件，有如下代码：</span></span></p>
<div>
<pre class="brush:cpp;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
  boost::shared_ptr&lt;TTransport&gt; socket(new TSocket(&quot;localhost&quot;, 9090));
  boost::shared_ptr&lt;TTransport&gt; transport(new TBufferedTransport(socket));
  boost::shared_ptr&lt;TProtocol&gt; protocol(new TBinaryProtocol(transport));
  HbaseClient client(protocol);
  try {
    transport-&gt;open();

    // do something

    transport-&gt;close();
  } catch (TException &amp;tx) {
    printf(&quot;ERROR: %s\n&quot;, tx.what());
  }</pre>
</div>
<p>
	<span style="font-size: 14px;"><span style="font-family: 宋体;">我们就仿照这个例子来做。从DemoClient.cpp可见，我们要先创建三个指针socket，transport和protocol，后两个分别依赖于前两个，最后再创建一个client对象，我们操作Hbase就是使用这个client对象。在操作Hbase前，需要先打开到Hbase Thrift service的连接，即 transport-&gt;open()，在操作完 Hbase之后，需要关闭连接，即 transport-&gt;close()，这下就比较清楚了：我们可以写一个自己的类CHbaseOperate，它应该有一个connect函数和一个disconnect函数，分别用于打开、关闭连接，还应该有读写Hbase的基本功能。读写Hbase的方法，请参考Hbase.h中的函数，例子还是看DemoClient.cpp。</span></span><br />
	<span style="color: rgb(255, 255, 255); font-family: arial, helvetica, sans-serif; font-size: 14px; line-height: 20px; text-align: left; background-color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a></p>
<p>
	<span style="font-size: 14px;"><span style="font-family: 宋体;">下面上代码：<br />
	<span style="background-color: #00ff00;">HbaseOperate.h：</span></span></span></p>
<pre class="brush:cpp;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
#ifndef __HBASE_OPERATE_H
#define __HBASE_OPERATE_H

#include &lt;string&gt;
#include &lt;protocol/TBinaryProtocol.h&gt;
#include &lt;transport/TSocket.h&gt;
#include &lt;transport/TTransportUtils.h&gt;
#include &quot;Hbase.h&quot;

/**
 * Class to operate Hbase.
 *
 * @author Darran Zhang (codelast.com)
 * @version 11-08-24
 * @declaration These codes are only for non-commercial use, and are distributed on an &quot;AS IS&quot; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
 * You must not remove this declaration at any time.
 */

using namespace apache::thrift;
using namespace apache::thrift::protocol;
using namespace apache::thrift::transport;
using namespace apache::hadoop::hbase::thrift;

typedef struct hbaseRet {
  std::string rowValue;
  time_t ts;

  hbaseRet() {
    ts = 0;
  }

} hbaseRet;

class CHbaseOperate
{
public:
	CHbaseOperate();
	virtual ~CHbaseOperate();

private:
  boost::shared_ptr&lt;TTransport&gt; socket;
  boost::shared_ptr&lt;TTransport&gt; transport;
  boost::shared_ptr&lt;TProtocol&gt; protocol;

  HbaseClient *client;

  std::string  hbaseServiceHost;
  int     hbaseServicePort;
  bool    isConnected;

public:
  bool  connect();

  bool  connect(std::string host, int port);

  bool  disconnect();

  bool  putRow(const std::string &amp;tableName,
              const std::string &amp;rowKey,
              const std::string &amp;column,
              const std::string &amp;rowValue);

  bool  getRow(hbaseRet &amp;result,
              const std::string &amp;tableName,
              const std::string &amp;rowKey,
              const std::string &amp;columnName);
};

#endif</pre>
<p>
	<span style="color: rgb(255, 255, 255); font-family: arial, helvetica, sans-serif; font-size: 14px; line-height: 20px; text-align: left; background-color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a></p>
<p>
	<span style="font-size: 14px;"><span style="font-family: 宋体;"><span style="background-color: #00ff00;">HbaseOperate.cpp：</span></span></span></p>
<pre class="brush:cpp;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
#include &quot;HbaseOperate.h&quot;
#include &quot;log4cxx/log4cxx.h&quot;
#include &quot;log4cxx/propertyconfigurator.h&quot;

static log4cxx::LoggerPtr logger(log4cxx::Logger::getLogger(&quot;HbaseOperate.cpp&quot;));

/**
 * Class to operate Hbase.
 *
 * @author Darran Zhang (codelast.com)
 * @version 11-08-24
 * @declaration These codes are only for non-commercial use, and are distributed on an &quot;AS IS&quot; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
 * You must not remove this declaration at any time.
 */

using namespace std;

CHbaseOperate::CHbaseOperate() :
socket((TSocket*)NULL), transport((TBufferedTransport*)NULL), protocol((TBinaryProtocol*)NULL), client(NULL), hbaseServicePort(9090), isConnected(false)
{
}

CHbaseOperate::~CHbaseOperate()
{
  if (isConnected) {
    disconnect();
  }
  if (NULL != client) {
    delete client;
    client = NULL;
  }
}

/**
 * Connect Hbase.
 *
 */
bool CHbaseOperate::connect()
{
  if (isConnected) {
    LOG4CXX_INFO(logger, &quot;Already connected, don&#39;t need to connect it again&quot;);
    return true;
  }

  try {
    socket.reset(new TSocket(hbaseServiceHost, hbaseServicePort));
    transport.reset(new TBufferedTransport(socket));
    protocol.reset(new TBinaryProtocol(transport));

    client = new HbaseClient(protocol);

    transport-&gt;open();
  } catch (const TException &amp;tx) {
    LOG4CXX_ERROR(logger, &quot;Connect Hbase error : &quot; &lt;&lt; tx.what());
    return false;
  }

  isConnected = true;
  return isConnected;
}

/**
 * Connect Hbase.
 *
 */
bool CHbaseOperate::connect(std::string host, int port)
{
  hbaseServiceHost = host;
  hbaseServicePort = port;

  return connect();
}

/**
 * Disconnect from Hbase.
 *
 */
bool CHbaseOperate::disconnect()
{
  if (!isConnected) {
    LOG4CXX_ERROR(logger, &quot;Haven&#39;t connected to Hbase yet, can&#39;t disconnect from it&quot;);
    return false;
  }

  if (NULL != transport) {
    try {
      transport-&gt;close();
    } catch (const TException &amp;tx) {
      LOG4CXX_ERROR(logger, &quot;Disconnect Hbase error : &quot; &lt;&lt; tx.what());
      return false;
    }
  } else {
    return false;
  }

  isConnected = false;
  return true;
}

/**
 * Put a row to Hbase.
 *
 * @param tableName   [IN] The table name.
 * @param rowKey      [IN] The row key.
 * @param column      [IN] The &quot;column family : qualifier&quot;.
 * @param rowValue    [IN] The row value.
 * @return True for successfully put the row, false otherwise.
 */
bool CHbaseOperate::putRow(const string &amp;tableName, const string &amp;rowKey, const string &amp;column, const string &amp;rowValue)
{
  if (!isConnected) {
    LOG4CXX_ERROR(logger, &quot;Haven&#39;t connected to Hbase yet, can&#39;t put row&quot;);
    return false;
  }

  try {
    std::vector&lt;Mutation&gt; mutations;
    mutations.push_back(Mutation());
    mutations.back().column = column;
    mutations.back().value = rowValue;
    client-&gt;mutateRow(tableName, rowKey, mutations);

  } catch (const TException &amp;tx) {
    LOG4CXX_ERROR(logger, &quot;Operate Hbase error : &quot; &lt;&lt; tx.what());
    return false;
  }

  return true;
}

/**
 * Get a Hbase row.
 *
 * @param result      [OUT] The object which contains the returned data.
 * @param tableName   [IN] The Hbase table name, e.g. &quot;MyTable&quot;.
 * @param rowKey      [IN] The Hbase row key, e.g. &quot;kdr23790&quot;.
 * @param columnName  [IN] The &quot;column family : qualifier&quot;.
 * @return True for successfully get the row, false otherwise.
 */
bool CHbaseOperate::getRow(hbaseRet &amp;result, const std::string &amp;tableName, const std::string &amp;rowKey, const std::string &amp;columnName)
{
  if (!isConnected) {
    LOG4CXX_ERROR(logger, &quot;Haven&#39;t connected to Hbase yet, can&#39;t read data from it&quot;);
    return false;
  }

  std::vector&lt;std::string&gt; columnNames;
  columnNames.push_back(columnName);

  std::vector&lt;TRowResult&gt; rowResult;
  try {
    client-&gt;getRowWithColumns(rowResult, tableName, rowKey, columnNames);
  } catch (const TException &amp;tx) {
    LOG4CXX_ERROR(logger, &quot;Operate Hbase error : &quot; &lt;&lt; tx.what());
    return false;
  }

  if (0 == rowResult.size()) {
    LOG4CXX_WARN(logger, &quot;Got no record with the key : [&quot; &lt;&lt; rowKey &lt;&lt; &quot;]&quot;);
    return false;
  }

  std::map&lt;std::string, TCell&gt;::const_iterator it = rowResult[rowResult.size() -1].columns.begin();
  result.rowValue = it-&gt;second.value;
  result.ts = it-&gt;second.timestamp;

  return true;
}</pre>
<p>
	<span style="font-size: 14px;"><span style="font-family: 宋体;">注意我在程序中使用了<a href="http://logging.apache.org/log4cxx/" target="_blank" rel="noopener noreferrer">Apache log4cxx</a>这个记录日志的库来打印/保存程序运行日志，使用方法可参考<span style="color: #ff0000;">【</span><a href="http://www.codelast.com/?p=3211" target="_blank" rel="noopener noreferrer">此链接</a><span style="color: #ff0000;">】</span>。如果你不想用，可以自己改为std::cout。<br />
	代码有了，使用方法为：可以在你的程序中创建一个全局对象：</span></span></p>
<pre class="brush:cpp;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
CHbaseOperate g_ho;</pre>
<p>
	<span style="font-size: 14px;"><span style="font-family: 宋体;">在需要操作Hbase之前：</span></span></p>
<pre class="brush:cpp;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
g_ho.connect(&quot;192.168.55.66&quot;, 9090);</pre>
<p>
	<span style="font-size: 14px;"><span style="font-family: 宋体;">其中，&ldquo;192.168.55.66&rdquo;和9090分别是你的Hbase Thrift service的服务器地址和端口号，你需要正确地配置好，才能使用。本文开头已经说了，本文不讨论这方面的问题。<br />
	在操作完Hbase之后：</span></span></p>
<pre class="brush:cpp;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
g_ho.disconnect();</pre>
<p>
	<span style="color: rgb(255, 255, 255); font-family: arial, helvetica, sans-serif; font-size: 14px; line-height: 20px; text-align: left; background-color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a><br />
	<span style="font-size: 14px;"><span style="font-family: 宋体;"> <span style="color: #000000;">现在再来说一下读写操作Hbase的两个函数：putRow()和getRow()。<br />
	<span style="background-color: #40e0d0;">putRow()：</span></span></span></span></p>
<pre class="brush:cpp;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
bool  putRow(const std::string &amp;tableName,
              const std::string &amp;rowKey,
              const std::string &amp;column,
              const std::string &amp;rowValue);</pre>
<p>
	<span style="font-size: 14px;"><span style="font-family: 宋体;"><span style="color: #000000;">这是向Hbase写入一条记录的函数，参数tableName为Hbase表名，即你要将记录写到哪个Hbase表中；参数rowKey为待写入的记录的key；参数column为待写入的记录的&ldquo;column family:qualifier&rdquo;组合，参数rowValue为待写入的记录的value。</span></span></span></p>
<p>
	<span style="font-size: 14px;"><span style="font-family: 宋体;"><span style="background-color: #40e0d0;">getRow()：</span></span></span></p>
<pre class="brush:cpp;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
bool  getRow(hbaseRet &amp;result,
              const std::string &amp;tableName,
              const std::string &amp;rowKey,
              const std::string &amp;columnName);</pre>
<p>
	<span style="font-size: 14px;"><span style="font-family: 宋体;"><span style="color: #000000;">这是从Hbase中读取一条记录的函数，参数tableName为Hbase表名，即你要从哪个Hbase表中读取记录；参数rowKey为你要查询的记录的key；参数columnName为你要查询的记录的&ldquo;column family:qualifier&rdquo;组合;参数result为返回的Hbase的数据，它包含记录的value和记录的时间戳：</span></span></span></p>
<pre class="brush:cpp;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
typedef struct hbaseRet {
  std::string rowValue;
  time_t ts; 

  hbaseRet() {
    ts = 0;
  }

} hbaseRet;</pre>
<p>
	<span style="color: rgb(255, 255, 255); font-family: arial, helvetica, sans-serif; font-size: 14px; line-height: 20px; text-align: left; background-color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a><br />
	<span style="font-size: 14px;"><span style="font-family: 宋体;"> <span style="color: #000000;">至于操作的结果对不对，可以在Hbase shell中用get, scan等命令来验证，具体方法请看Hbase shell的help。另外，最好再写一些unit test来测试。<br />
	如果你要为CHbaseOperate类添加功能，可以参考Hbase.h文件中的函数定义。如你所见，CHbaseOperate类主要也是调用了里面的函数，只不过这个类可以让一些不太熟悉Hbase概念的人可以更方便地操作Hbase罢了。</span></span></span></p>
<p>	<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
	<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;版权声明&nbsp;<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;<br />
	转载需注明出处：<u><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><em><span style="color: rgb(0, 0, 255);"><strong style="font-size: 16px;"><span style="font-family: arial, helvetica, sans-serif;">codelast.com</span></strong></span></em></a></u>&nbsp;<br />
	感谢关注我的微信公众号（微信扫一扫）：</p>
<p style="border: 0px; font-size: 13px; margin: 0px 0px 9px; outline: 0px; padding: 0px; color: rgb(77, 77, 77);">
	<img decoding="async" alt="wechat qrcode of codelast" src="https://www.codelast.com/codelast_wechat_qr_code.jpg" style="width: 200px; height: 200px;" /></p>

			<!--[syntaxhighlighter]-->
			<!--代码高亮，请勿编辑-->
			<script type="text/javascript" src="https://www.codelast.com/wp-content/plugins/ck-and-syntaxhighlighter/syntaxhighlighter/scripts/shCore.js"></script><script type="text/javascript" src="https://www.codelast.com/wp-content/plugins/ck-and-syntaxhighlighter/syntaxhighlighter/scripts/shBrushShell.js"></script>
<script type="text/javascript" src="https://www.codelast.com/wp-content/plugins/ck-and-syntaxhighlighter/syntaxhighlighter/scripts/shBrushCpp.js"></script>

			<link type="text/css" rel="stylesheet" href="https://www.codelast.com/wp-content/plugins/ck-and-syntaxhighlighter/syntaxhighlighter/styles/shCoreCk.css" />
			<link type="text/css" rel="stylesheet" href="https://www.codelast.com/wp-content/plugins/ck-and-syntaxhighlighter/syntaxhighlighter/styles/shThemeCk.css" />
			<script type="text/javascript">
			SyntaxHighlighter.defaults['class-name']	= '';
			SyntaxHighlighter.defaults['smart-tabs']	= true;
			SyntaxHighlighter.defaults['tab-size']		= 2;
			SyntaxHighlighter.defaults['gutter']		= true;
			SyntaxHighlighter.defaults['quick-code']	= true;
			SyntaxHighlighter.defaults['collapse'] 		= false;
			SyntaxHighlighter.defaults['auto-links']	= true;
			SyntaxHighlighter.defaults['toolbar']		= true;
			SyntaxHighlighter.all();
			</script>
			<!--[/syntaxhighlighter]-->]]></content:encoded>
					
					<wfw:commentRss>https://www.codelast.com/%e5%8e%9f%e5%88%9b%e4%bd%bf%e7%94%a8c%ef%bc%88%e9%80%9a%e8%bf%87thrift%ef%bc%89%e8%ae%bf%e9%97%aehbase/feed/</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
			</item>
		<item>
		<title>[原创] Techniques 中文翻译（Google Protocol Buffers中文教程）</title>
		<link>https://www.codelast.com/%e5%8e%9f%e5%88%9b-techniques-%e4%b8%ad%e6%96%87%e7%bf%bb%e8%af%91%ef%bc%88google-protocol-buffers%e4%b8%ad%e6%96%87%e6%95%99%e7%a8%8b%ef%bc%89/</link>
					<comments>https://www.codelast.com/%e5%8e%9f%e5%88%9b-techniques-%e4%b8%ad%e6%96%87%e7%bf%bb%e8%af%91%ef%bc%88google-protocol-buffers%e4%b8%ad%e6%96%87%e6%95%99%e7%a8%8b%ef%bc%89/#comments</comments>
		
		<dc:creator><![CDATA[learnhard]]></dc:creator>
		<pubDate>Tue, 14 Sep 2010 05:37:00 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[Buffer]]></category>
		<category><![CDATA[Google Protocol Buffers]]></category>
		<category><![CDATA[Protocol]]></category>
		<category><![CDATA[Protocol Buffer]]></category>
		<category><![CDATA[Protocol Buffers]]></category>
		<category><![CDATA[Techniques]]></category>
		<category><![CDATA[中文]]></category>
		<category><![CDATA[教程]]></category>
		<category><![CDATA[翻译]]></category>
		<guid isPermaLink="false">http://www.codelast.com/?p=316</guid>

					<description><![CDATA[<h1>
	<b><span lang="EN-US" style="font-size:20.5pt;font-family:&#34;Helvetica&#34;,&#34;sans-serif&#34;;
color:black;mso-font-kerning:18.0pt">Techniques </span></b><b><span style="font-size:20.5pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:18.0pt">技巧</span></b></h1>
<p align="left" class="MsoNormal" style="margin-left:-7.5pt;text-align:left;
line-height:26.25pt;mso-pagination:widow-orphan;mso-outline-level:1"><br />
	<b><span lang="EN-US" style="font-size:
20.5pt;font-family:&#34;Helvetica&#34;,&#34;sans-serif&#34;;color:black;mso-font-kerning:18.0pt"><o:p></o:p></span></b></p>
<h1>
	<span style="font-family:微软雅黑;"><span style="font-size:14px;">注：这是本人的翻译，可能不准确，可能有错误，但是基本上可以理解，希望能对大家有所帮助！（<span style="color:#ff0000;">转载须注明出处</span>：本文来自learnhard的博客：<a href="http://www.codelast.com/" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: rgb(0, 77, 153); " target="_blank" rel="noopener noreferrer"><span style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 255); ">http://www.codelast.com/</span></a>&#38;&#160;<a href="http://blog.csdn.net/learnhard/" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: rgb(0, 77, 153); "><span style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 255); ">http://blog.csdn.net/learnhard/</span></a>）</span></span></h1>
<p>
<span id="more-316"></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l1 level1 lfo1;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&#183;<span style="font:7.0pt &#34;Times New Roman&#34;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&#34;Helvetica&#34;,&#34;sans-serif&#34;;color:black;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/techniques.html#streaming"><span style="color:#0000CC">Streaming Multiple Messages</span></a><o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l1 level1 lfo1;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&#183;<span style="font:7.0pt &#34;Times New Roman&#34;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&#34;Helvetica&#34;,&#34;sans-serif&#34;;color:black;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/techniques.html#large-data"><span style="color:#0000CC">Large Data Sets</span></a><o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l1 level1 lfo1;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&#183;<span style="font:7.0pt &#34;Times New Roman&#34;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&#34;Helvetica&#34;,&#34;sans-serif&#34;;color:black;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/techniques.html#union"><span style="color:#0000CC">Union Types</span></a><o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l1 level1 lfo1;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&#183;<span style="font:7.0pt &#34;Times New Roman&#34;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&#34;Helvetica&#34;,&#34;sans-serif&#34;;color:black;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/techniques.html#self-description"><span style="color:#0000CC">Self-describing Messages</span></a><o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&#34;Helvetica&#34;,&#34;sans-serif&#34;;color:black;mso-font-kerning:0pt">This page describes some commonly-used design patterns for dealing with Protocol Buffers. You can also send design and usage questions to the&#160;<a href="http://groups.google.com/group/protobuf"><span style="color:#0000CC">Protocol Buffers discussion group</span></a>.</span>&#8230; <a href="https://www.codelast.com/%e5%8e%9f%e5%88%9b-techniques-%e4%b8%ad%e6%96%87%e7%bf%bb%e8%af%91%ef%bc%88google-protocol-buffers%e4%b8%ad%e6%96%87%e6%95%99%e7%a8%8b%ef%bc%89/" class="read-more">Read More </a></p>]]></description>
										<content:encoded><![CDATA[<h1>
	<b><span lang="EN-US" style="font-size:20.5pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:18.0pt">Techniques </span></b><b><span style="font-size:20.5pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:18.0pt">技巧</span></b></h1>
<p align="left" class="MsoNormal" style="margin-left:-7.5pt;text-align:left;
line-height:26.25pt;mso-pagination:widow-orphan;mso-outline-level:1"><br />
	<b><span lang="EN-US" style="font-size:
20.5pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:18.0pt"><o:p></o:p></span></b></p>
<h1>
	<span style="font-family:微软雅黑;"><span style="font-size:14px;">注：这是本人的翻译，可能不准确，可能有错误，但是基本上可以理解，希望能对大家有所帮助！（<span style="color:#ff0000;">转载须注明出处</span>：本文来自learnhard的博客：<a href="http://www.codelast.com/" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: rgb(0, 77, 153); " target="_blank" rel="noopener noreferrer"><span style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 255); ">http://www.codelast.com/</span></a>&amp;&nbsp;<a href="http://blog.csdn.net/learnhard/" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: rgb(0, 77, 153); "><span style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 255); ">http://blog.csdn.net/learnhard/</span></a>）</span></span></h1>
<p>
<span id="more-316"></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l1 level1 lfo1;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/techniques.html#streaming"><span style="color:#0000CC">Streaming Multiple Messages</span></a><o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l1 level1 lfo1;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/techniques.html#large-data"><span style="color:#0000CC">Large Data Sets</span></a><o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l1 level1 lfo1;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/techniques.html#union"><span style="color:#0000CC">Union Types</span></a><o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l1 level1 lfo1;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/techniques.html#self-description"><span style="color:#0000CC">Self-describing Messages</span></a><o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">This page describes some commonly-used design patterns for dealing with Protocol Buffers. You can also send design and usage questions to the&nbsp;<a href="http://groups.google.com/group/protobuf"><span style="color:#0000CC">Protocol Buffers discussion group</span></a>.<br />
	<span style="color: rgb(255, 255, 255); font-family: arial, helvetica, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a><o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><o:p> </o:p></span></p>
<h1>
	<span lang="EN-US" style="line-height: 15pt; text-align: left; text-indent: -21pt; font-size: 12pt; font-family: Wingdings; color: blue; ">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span><b style="line-height: 15pt; text-align: left; text-indent: -21pt; "><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">将多个消息转化为流</span></b></h1>
<p align="left" class="MsoNormal" style="margin-left:21.0pt;text-align:left;
text-indent:-21.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l0 level1 lfo2"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings;color:blue;mso-font-kerning:0pt"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">大数据集</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-left:21.0pt;text-align:left;
text-indent:-21.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l0 level1 lfo2"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings;color:blue;mso-font-kerning:0pt"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">联合类型</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-left:21.0pt;text-align:left;
text-indent:-21.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l0 level1 lfo2"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings;color:blue;mso-font-kerning:0pt"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">自描述的消息</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">本文描述了处理</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">Protocol Buffers</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">的时候一些常用的设计模式。你也可以向</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">Protocol Buffers</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">讨论组（</span></b><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><a href="http://groups.google.com/group/protobuf"><span style="color:#0000CC">Protocol Buffers discussion group</span></a></span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">）发送设计和使用方面的问题寻求解答。</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p>&nbsp;</o:p></span></b></p>
<div style="mso-element:para-border-div;border:none;border-top:solid #3366CC 1.0pt;
mso-border-top-alt:solid #3366CC .75pt;padding:1.0pt 0cm 0cm 0cm;background:
#E5ECF9;margin-left:-7.5pt;margin-right:0cm"></p>
<p align="left" class="MsoNormal" style="margin-top:24.0pt;text-align:left;
mso-pagination:widow-orphan;mso-outline-level:2;background:#E5ECF9;border:none;
mso-border-top-alt:solid #3366CC .75pt;padding:0cm;mso-padding-alt:1.0pt 0cm 0cm 0cm"><br />
		<b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">Streaming Multiple Messages </span></b><b><span style="font-size:15.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">将多个消息转化为流</span></b><b><span lang="EN-US" style="font-size:
15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
</div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">If you want to write multiple messages to a single file or stream, it is up to you to keep track of where one message ends and the next begins. The Protocol Buffer wire format is not self-delimiting, so protocol buffer parsers cannot determine where a message ends on their own. The easiest way to solve this problem is to write the size of each message before you write the message itself. When you read the messages back in, you read the size, then read the bytes into a separate buffer, then parse from that buffer. (If you want to avoid copying bytes to a separate buffer, check out the&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">CodedInputStream</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;class (in both C++ and Java) which can be told to limit reads to a certain number of bytes.)<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">如果你想将多个消息写入一个文件或流（</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">stream</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">）中，那么是由你来记录一个消息的终点以及另一个消息的起点的。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">Protocol Buffer</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:
12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:
Helvetica;mso-bidi-font-family:Helvetica;color:blue;mso-font-kerning:0pt">数据传输格式不是自我限定的（</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">self-delimiting</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">），所以</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">protocol buffer</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">解析器无法自己决定一个消息结束于何处。解决这个问题的最简单的方法就是：在写入每一个消息之前，先写入消息的大小。当你读取消息的时候，先读取消息大小，然后将指定的字节数读入一个独立的缓冲区中，然后再解析缓冲区里的东西。如果你不想将数据拷贝到一个独立的缓冲区中，请查看</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">CodedInputStream</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">类（</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">C++</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">和</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">Java</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">都可用）的使用方法&mdash;&mdash;你可以用它来限制只读取指定字节的数据。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span style="color: rgb(255, 255, 255); font-family: arial, helvetica, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a></p>
<div style="mso-element:para-border-div;border:none;border-top:solid #3366CC 1.0pt;
mso-border-top-alt:solid #3366CC .75pt;padding:1.0pt 0cm 0cm 0cm;background:
#E5ECF9;margin-left:-7.5pt;margin-right:0cm"></p>
<p align="left" class="MsoNormal" style="margin-top:24.0pt;text-align:left;
mso-pagination:widow-orphan;mso-outline-level:2;background:#E5ECF9;border:none;
mso-border-top-alt:solid #3366CC .75pt;padding:0cm;mso-padding-alt:1.0pt 0cm 0cm 0cm"><br />
		<b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">Large Data Sets </span></b><b><span style="font-size:15.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">大数据集</span></b><b><span lang="EN-US" style="font-size:15.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
</div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">Protocol Buffers are not designed to handle large messages. As a general rule of thumb, if you are dealing in messages larger than a megabyte each, it may be time to consider an alternate strategy.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">Protocol Buffers</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">不是设计来处理大消息的。根据一般经验，如果你要处理的单条消息大于</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">1M</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">，那就是采取其他策略的时候了。</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt"><o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><o:p>&nbsp;</o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">That said, Protocol Buffers are great for handling individual messages&nbsp;<i>within</i>&nbsp;a large data set. Usually, large data sets are really just a collection of small pieces, where each small piece may be a structured piece of data. Even though Protocol Buffers cannot handle the entire set at once, using Protocol Buffers to encode each piece greatly simplifies your problem: now all you need is to handle a set of byte strings rather than a set of structures.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">也就是说，</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">Protocol Buffers</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">非常适合于处理一个大数据集内有多个单独的消息。通常，大数据集只是许多小块数据的集合，每一小块都是一块结构化的数据。即使是这样，</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">Protocol Buffers</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">也不能马上处理整个数据集，使用</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">Protocol Buffers</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">来编码每一块数据可以极大地简化你的问题：现在你所需要的只是处理一组字符串，而不是一组结构体了。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><o:p>&nbsp;</o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">Protocol Buffers do not include any built-in support for large data sets because different situations call for different solutions. Sometimes a simple list of records will do while other times you may want something more like a database. Each solution should be developed as a separate library, so that only those who need it need to pay the costs.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">Protocol Buffers</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">没有内置任何对大数据集的支持，因为不同的情况需要不同的解决方案。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">有时，一个简单的记录列表就解决问题了，而在某些情况下，你可能更想要的是类似于数据库的东西。每个解决方案都应该作为一个独立的库来开发，所以只有需要它的人才需要付出代价。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p>&nbsp;</o:p></span></b></p>
<div style="mso-element:para-border-div;border:none;border-top:solid #3366CC 1.0pt;
mso-border-top-alt:solid #3366CC .75pt;padding:1.0pt 0cm 0cm 0cm;background:
#E5ECF9;margin-left:-7.5pt;margin-right:0cm"></p>
<p align="left" class="MsoNormal" style="margin-top:24.0pt;text-align:left;
mso-pagination:widow-orphan;mso-outline-level:2;background:#E5ECF9;border:none;
mso-border-top-alt:solid #3366CC .75pt;padding:0cm;mso-padding-alt:1.0pt 0cm 0cm 0cm"><br />
		<b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">Union Types </span></b><b><span style="font-size:15.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">联合类型</span></b><b><span lang="EN-US" style="font-size:15.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
</div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">You may sometimes want to send a message that could be one of several different types. However, protocol buffer parsers cannot necessarily determine the type of a message based on the contents alone. So how do you make sure that the recipient application knows how to decode your message? One solution is to create a wrapper message that has one optional field for each possible message type.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">有时，你可能想发送一个消息，它的类型可以是几种不同的类型之一。然而，</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">protocol buffer</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:
12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:
Helvetica;mso-bidi-font-family:Helvetica;color:blue;mso-font-kerning:0pt">解析器无法仅凭消息内容来决定消息的类型。所以，你如何确保接收方应用程序能知道怎么解析消息呢？有一个解决方案是：创建一个封装的消息，其含有</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">N</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">个</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">optional</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">的字段，每一个字段对应一种可能的消息类型。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span style="color: rgb(255, 255, 255); font-family: arial, helvetica, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">For example, if you have message types&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">Foo</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">,&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">Bar</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">, and&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">Baz</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">, you can combine them with a type like:<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">例如，如果你有消息类型</span></b><span lang="EN-US" style="font-size:
10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;
mso-font-kerning:0pt">Foo</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">，</span></b><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">Bar</span><b style="mso-bidi-font-weight:normal"><span style="font-size:
12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:
Helvetica;mso-bidi-font-family:Helvetica;color:blue;mso-font-kerning:0pt">和</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">Baz</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">，那么你可以将它们与类型结合起来，像这样：</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<div style="mso-element:para-border-div;border:solid #BBBBBB 1.0pt;mso-border-alt:
solid #BBBBBB .75pt;padding:12.0pt 12.0pt 12.0pt 12.0pt;background:#FAFAFA"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">message OneMessage {<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>// One of the following will be filled in.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>optional Foo foo = 1;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>optional Bar bar = 2;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>optional Baz baz = 3;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">}<o:p></o:p></span></p>
</div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">You may also want to have an enum field that identifies which message is filled in, so that you can&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">switch</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;on it:<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">你也可能想这样做：添加一个枚举字段来标识是哪个消息被填充了，这样的话你就可以对它使用</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">switch</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">（来进行不同的处理）：</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<div style="mso-element:para-border-div;border:solid #BBBBBB 1.0pt;mso-border-alt:
solid #BBBBBB .75pt;padding:12.0pt 12.0pt 12.0pt 12.0pt;background:#FAFAFA"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">message OneMessage {<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>enum Type { FOO = 1; BAR = 2; BAZ = 3; }<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><o:p>&nbsp;</o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>// Identifies which field is filled in.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>required Type type = 1;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><o:p>&nbsp;</o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>// One of the following will be filled in.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>optional Foo foo = 2;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>optional Bar bar = 3;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>optional Baz baz = 4;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">}<o:p></o:p></span></p>
</div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">If you have a very large number of possible types, listing every one of them in your container type may be unwieldy. Instead, you should consider using&nbsp;<a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html#extensions"><span style="color:#0000CC">extensions</span></a>:<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">如果你有大量&ldquo;可能的类型&rdquo;，那么在你的容器类型中将它们一一列举出来可能非常困难。在这种情况下，你应该考虑使用扩展（</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html#extensions"><span style="color:#0000CC">extensions</span></a></span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">）：</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<div style="mso-element:para-border-div;border:solid #BBBBBB 1.0pt;mso-border-alt:
solid #BBBBBB .75pt;padding:12.0pt 12.0pt 12.0pt 12.0pt;background:#FAFAFA"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">message OneMessage {<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>extensions 100 to max;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">}<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><o:p>&nbsp;</o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">// Elsewhere...<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">extend OneMessage {<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>optional Foo foo_ext = 100;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>optional Bar bar_ext = 101;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>optional Baz baz_ext = 102;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">}<o:p></o:p></span></p>
</div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">Note that you can use the&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">ListFields</span><span lang="EN-US" style="font-size:12.0pt;font-family:
&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">&nbsp;reflection method (in C++, Java, and Python) to get a list of all fields present in the message, including extensions. You might use this as part of a scheme for registering handlers for diverse message types.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">注意：你可以使用反射函数</span></b><span lang="EN-US" style="font-size:
10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;
mso-font-kerning:0pt">ListFields</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">（</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">C++</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">，</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">Java</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">和</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">Python</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">都可用）来获取一个消息中的所有字段的列表（包括扩展）。在实现一个为不同消息类型分别注册句柄的技术方案的时候，你可能用得上这个功能。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><o:p>&nbsp;</o:p></span></p>
<div style="mso-element:para-border-div;border:none;border-top:solid #3366CC 1.0pt;
mso-border-top-alt:solid #3366CC .75pt;padding:1.0pt 0cm 0cm 0cm;background:
#E5ECF9;margin-left:-7.5pt;margin-right:0cm"></p>
<p align="left" class="MsoNormal" style="margin-top:24.0pt;text-align:left;
mso-pagination:widow-orphan;mso-outline-level:2;background:#E5ECF9;border:none;
mso-border-top-alt:solid #3366CC .75pt;padding:0cm;mso-padding-alt:1.0pt 0cm 0cm 0cm"><br />
		<b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">Self-describing Messages </span></b><b><span style="font-size:15.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">自描述的消息</span></b><b><span lang="EN-US" style="font-size:
15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
</div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">Protocol Buffers do not contain descriptions of their own types. Thus, given only a raw message without the corresponding&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">.proto</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;file defining its type, it is difficult to extract any useful data.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">However, note that the contents of a .proto file can itself be represented using protocol buffers. The file&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">src/google/protobuf/descriptor.proto</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">in the source code package defines the message types involved.&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">protoc</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;can output a&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">FileDescriptorSet</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;&ndash; which represents a set of .proto files &ndash; using the&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">--descriptor_set_out</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;option. With this, you could define a self-describing protocol message like so:<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">Protocol Buffers</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">不包含自我类型描述的信息。因此，如果只提供原始消息，而不提供对应的</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">.proto</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">文件，你将很难从中提取出任何有用的数据。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">然而，请注意：一个</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">.proto</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">文件的内容可以使用</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">protocol buffers</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">来描述。通过使用</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">--descriptor_set_out</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">选项，源代码包中的</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">src/google/protobuf/descriptor.proto</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">文件定义了相关的消息类型。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">protoc</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">编译器可以输出一个</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">FileDescriptorSet</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">&mdash;&mdash;这个集合表示一系列的</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">.proto</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">文件。利用它，你可以像这样定义一个自描述的协议消息：</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p>&nbsp;</o:p></span></b></p>
<div style="mso-element:para-border-div;border:solid #BBBBBB 1.0pt;mso-border-alt:
solid #BBBBBB .75pt;padding:12.0pt 12.0pt 12.0pt 12.0pt;background:#FAFAFA"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">message SelfDescribingMessage {<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>// Set of .proto files which define the type.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp;</span><span style="mso-spacerun:yes">&nbsp;</span>required FileDescriptorSet proto_files = 1;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><o:p>&nbsp;</o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>// Name of the message type.<span style="mso-spacerun:yes">&nbsp; </span>Must be defined by one of the files in<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>// proto_files.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>required string type_name = 2;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><o:p>&nbsp;</o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>// The message data.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>required bytes message_data = 3;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">}<o:p></o:p></span></p>
</div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">By using classes like&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">DynamicMessage</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;(available in C++ and Java), you can then write tools which can manipulate&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">SelfDescribingMessage</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">s.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">All that said, the reason that this functionality is not included in the Protocol Buffer library is because we have never had a use for it inside Google.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">通过使用像</span></b><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">DynamicMessage</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">这样的类（</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">C++</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">和</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">Java</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">都可用），你可以编写出操作</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">SelfDescribingMessage</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">的工具。</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">总之，</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">Protocol Buffer</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">库之所以没有包含这个特性，是因为我们在</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">Google</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">还从没有需要用它的机会。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<br />
	<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
	<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;版权声明&nbsp;<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;<br />
	转载需注明出处：<u><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><em><span style="color: rgb(0, 0, 255);"><strong style="font-size: 16px;"><span style="font-family: arial, helvetica, sans-serif;">codelast.com</span></strong></span></em></a></u>&nbsp;<br />
	感谢关注我的微信公众号（微信扫一扫）：</p>
<p style="border: 0px; font-size: 13px; margin: 0px 0px 9px; outline: 0px; padding: 0px; color: rgb(77, 77, 77);">
	<img decoding="async" alt="wechat qrcode of codelast" src="https://www.codelast.com/codelast_wechat_qr_code.jpg" style="width: 200px; height: 200px;" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codelast.com/%e5%8e%9f%e5%88%9b-techniques-%e4%b8%ad%e6%96%87%e7%bf%bb%e8%af%91%ef%bc%88google-protocol-buffers%e4%b8%ad%e6%96%87%e6%95%99%e7%a8%8b%ef%bc%89/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>[原创] Style Guide中文翻译（Google Protocol Buffers中文教程）</title>
		<link>https://www.codelast.com/%e5%8e%9f%e5%88%9b-style-guide%e4%b8%ad%e6%96%87%e7%bf%bb%e8%af%91%ef%bc%88google-protocol-buffers%e4%b8%ad%e6%96%87%e6%95%99%e7%a8%8b%ef%bc%89/</link>
					<comments>https://www.codelast.com/%e5%8e%9f%e5%88%9b-style-guide%e4%b8%ad%e6%96%87%e7%bf%bb%e8%af%91%ef%bc%88google-protocol-buffers%e4%b8%ad%e6%96%87%e6%95%99%e7%a8%8b%ef%bc%89/#respond</comments>
		
		<dc:creator><![CDATA[learnhard]]></dc:creator>
		<pubDate>Tue, 14 Sep 2010 05:30:16 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[Buffer]]></category>
		<category><![CDATA[Google Protocol Buffers]]></category>
		<category><![CDATA[Protocol]]></category>
		<category><![CDATA[Protocol Buffer]]></category>
		<category><![CDATA[Protocol Buffers]]></category>
		<category><![CDATA[Style Guide]]></category>
		<category><![CDATA[中文]]></category>
		<category><![CDATA[教程]]></category>
		<category><![CDATA[翻译]]></category>
		<guid isPermaLink="false">http://www.codelast.com/?p=305</guid>

					<description><![CDATA[<h1>
	<b><span style="font-size:20.5pt;Helvetica&#34;,&#34;sans-serif&#34;;
color:black;">Style Guide </span></b><b><span style="font-size:20.5pt;color:blue;">风格指南</span></b></h1>
<div align="left" style="margin-left:-7.5pt;text-align:left;
line-height:26.25pt;">
<div align="left" style="margin-left:-7.5pt;text-align:left;
line-height:26.25pt;"><br />
		<span style="font-size:14px;"><span style="font-family:微软雅黑;"><font class="Apple-style-span" color="#000000">注：这是本人的翻译，可能不准确，可能有错误，但是基本上可以理解，希望能对大家有所帮助！（</font><strong><span style="color:#ff0000;"><font class="Apple-style-span">转载须注明出处</font></span></strong><font class="Apple-style-span" color="#000000">：本文来自learnhard的博客：<a href="http://www.codelast.com/" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: rgb(0, 77, 153); " target="_blank" rel="noopener noreferrer"><span style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 255); ">http://www.codelast.com/</span></a>&#38;&#160;<a href="http://blog.csdn.net/learnhard/" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: rgb(0, 77, 153); "><span style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 255); ">http://blog.csdn.net/learnhard/</span></a>）</font></span></span></div>
<div align="left" style="margin-left:-7.5pt;text-align:left;
line-height:26.25pt;"><br />
<span id="more-305"></span>	</div>
<div align="left" style="text-align:left;line-height:15.0pt;">
		<font class="Apple-style-span" color="#000000" size="7"><span style="font-size:12.0pt;Helvetica&#34;,&#34;sans-serif&#34;;color:black;">This document provides a style guide for&#160;</span><span style="font-size:10.0pt;Courier New&#34;;
color:#007000;">.proto</span><span style="font-size:12.0pt;Helvetica&#34;,&#34;sans-serif&#34;;color:black;">&#160;files. By following these conventions, you&#39;ll make your protocol buffer message definitions and their corresponding classes consistent and easy to read.</span></font></div>
<div align="left" style="text-align:left;line-height:15.0pt;">
		<font class="Apple-style-span" color="#000000" size="7"><b><span style="font-size:12.0pt;color:blue;">本文档提供了</span></b><b><span style="font-size:12.0pt;Helvetica&#34;,&#34;sans-serif&#34;;
color:blue;">.proto</span></b></font></div></div>&#8230; <a href="https://www.codelast.com/%e5%8e%9f%e5%88%9b-style-guide%e4%b8%ad%e6%96%87%e7%bf%bb%e8%af%91%ef%bc%88google-protocol-buffers%e4%b8%ad%e6%96%87%e6%95%99%e7%a8%8b%ef%bc%89/" class="read-more">Read More </a>]]></description>
										<content:encoded><![CDATA[<h1>
	<b><span style="font-size:20.5pt;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;">Style Guide </span></b><b><span style="font-size:20.5pt;color:blue;">风格指南</span></b></h1>
<div align="left" style="margin-left:-7.5pt;text-align:left;
line-height:26.25pt;"></p>
<div align="left" style="margin-left:-7.5pt;text-align:left;
line-height:26.25pt;"><br />
		<span style="font-size:14px;"><span style="font-family:微软雅黑;"><font class="Apple-style-span" color="#000000">注：这是本人的翻译，可能不准确，可能有错误，但是基本上可以理解，希望能对大家有所帮助！（</font><strong><span style="color:#ff0000;"><font class="Apple-style-span">转载须注明出处</font></span></strong><font class="Apple-style-span" color="#000000">：本文来自learnhard的博客：<a href="http://www.codelast.com/" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: rgb(0, 77, 153); " target="_blank" rel="noopener noreferrer"><span style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 255); ">http://www.codelast.com/</span></a>&amp;&nbsp;<a href="http://blog.csdn.net/learnhard/" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: rgb(0, 77, 153); "><span style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 0, 255); ">http://blog.csdn.net/learnhard/</span></a>）</font></span></span></div>
<div align="left" style="margin-left:-7.5pt;text-align:left;
line-height:26.25pt;"><br />
<span id="more-305"></span>	</div>
<div align="left" style="text-align:left;line-height:15.0pt;">
		<font class="Apple-style-span" color="#000000" size="7"><span style="font-size:12.0pt;Helvetica&quot;,&quot;sans-serif&quot;;color:black;">This document provides a style guide for&nbsp;</span><span style="font-size:10.0pt;Courier New&quot;;
color:#007000;">.proto</span><span style="font-size:12.0pt;Helvetica&quot;,&quot;sans-serif&quot;;color:black;">&nbsp;files. By following these conventions, you&#39;ll make your protocol buffer message definitions and their corresponding classes consistent and easy to read.</span></font></div>
<div align="left" style="text-align:left;line-height:15.0pt;">
		<font class="Apple-style-span" color="#000000" size="7"><b><span style="font-size:12.0pt;color:blue;">本文档提供了</span></b><b><span style="font-size:12.0pt;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;">.proto</span></b><b><span style="font-size:12.0pt;
color:blue;">文件的书写风格指南。通过遵守这些约定，你的</span></b><b><span style="font-size:12.0pt;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;">protocol buffer</span></b><b><span style="font-size:
12.0pt;color:blue;">消息定义和它们的对应类将会风格一致且易于阅读。</span></b></font></div>
<div align="left" style="text-align:left;line-height:15.0pt;">
		&nbsp;</div>
<div style="border:none;border-top:solid #3366CC 1.0pt;padding:1.0pt 0cm 0cm 0cm;background:
#E5ECF9;margin-left:-7.5pt;margin-right:0cm"></p>
<div align="left" style="margin-top:24.0pt;text-align:left;background:#E5ECF9;border:none;padding:0cm;">
			<font class="Apple-style-span" color="#000000" size="7"><b><span style="font-size:15.0pt;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;">Message And Field Names </span></b><b><span style="font-size:15.0pt;color:blue;">消息和字段名</span></b></font></div>
</p></div>
<div align="left" style="text-align:left;line-height:15.0pt;">
		<font class="Apple-style-span" color="#000000" size="7"><span style="font-size:12.0pt;Helvetica&quot;,&quot;sans-serif&quot;;color:black;">Use CamelCase (with an initial capital) for message names &ndash; for example,&nbsp;</span><span style="font-size:10.0pt;Courier New&quot;;
color:#007000;">SongServerRequest</span><span style="font-size:12.0pt;Helvetica&quot;,&quot;sans-serif&quot;;color:black;">. Use underscore_separated_names for field names &ndash; for example,&nbsp;</span><span style="font-size:10.0pt;Courier New&quot;;color:#007000;">song_name</span><span style="font-size:12.0pt;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;">.</span></font></div>
<div align="left" style="text-align:left;line-height:15.0pt;">
		<font class="Apple-style-span" color="#000000" size="7"><b><span style="font-size:12.0pt;color:blue;">消息名使用驼峰格式（每个单词首字母大写）来书写&mdash;&mdash;例如</span></b><span style="font-size:10.0pt;Courier New&quot;;
color:#007000;">SongServerRequest</span><b><span style="font-size:12.0pt;color:blue;">。字段名使用小写的下划线分隔式（</span></b><span style="font-size:12.0pt;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;">underscore_separated_names</span><b><span style="font-size:12.0pt;color:blue;">）来书写&mdash;&mdash;例如</span></b><span style="font-size:10.0pt;Courier New&quot;;
color:#007000;">song_name</span><b><span style="font-size:12.0pt;
color:blue;">。</span></b></font></div>
<div align="left" style="text-align:left;line-height:15.0pt;">
		<span style="color: rgb(255, 255, 255); font-family: arial, helvetica, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a></div>
<div align="left" style="text-align:left;line-height:15.0pt;">
		&nbsp;</div>
<div style="border:solid #BBBBBB 1.0pt;padding:12.0pt 12.0pt 12.0pt 12.0pt;background:#FAFAFA">
<div align="left" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;
background:#FAFAFA;border:none;padding:0cm;"><br />
			<font class="Apple-style-span" color="#000000" size="7"><span style="font-size:
9.0pt;Courier New&quot;;color:#007000;">message SongServerRequest {</span></font></div>
<div align="left" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;
background:#FAFAFA;border:none;padding:0cm;"><br />
			<font class="Apple-style-span" color="#000000" size="7"><span style="font-size:
9.0pt;Courier New&quot;;color:#007000;">&nbsp;required string song_name = 1;</span></font></div>
<div align="left" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;
background:#FAFAFA;border:none;padding:0cm;"><br />
			<font class="Apple-style-span" color="#000000" size="7"><span style="font-size:
9.0pt;Courier New&quot;;color:#007000;">}</span></font></div>
</p></div>
<div align="left" style="text-align:left;line-height:15.0pt;">
		<font class="Apple-style-span" color="#000000" size="7"><span style="font-size:12.0pt;Helvetica&quot;,&quot;sans-serif&quot;;color:black;">Using this naming convention for field names gives you accessors like the following:</span></font></div>
<div align="left" style="text-align:left;line-height:15.0pt;">
		<font class="Apple-style-span" color="#000000" size="7"><b><span style="font-size:12.0pt;color:blue;">字段名使用这种形式的命名约定的话，生成的访问类中的函数就有如下形式：</span></b></font></div>
<div style="border:solid #BBBBBB 1.0pt;padding:12.0pt 12.0pt 12.0pt 12.0pt;background:#FAFAFA">
<div align="left" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;
background:#FAFAFA;border:none;padding:0cm;"><br />
			<font class="Apple-style-span" color="#000000" size="7"><span style="font-size:
9.0pt;Courier New&quot;;color:black;">C</span><span style="font-size:9.0pt;Courier New&quot;;color:#666600;">++:</span><br />
			<span style="font-size:9.0pt;Courier New&quot;;
color:black;"> </span>&nbsp;<span style="font-size:9.0pt;Courier New&quot;;
color:#000088;">const</span><span style="font-size:
9.0pt;Courier New&quot;;color:#000088;">string</span><span style="font-size:9.0pt;Courier New&quot;;color:#666600;">&amp;</span><span style="font-size:9.0pt;Courier New&quot;;color:black;"> song_name</span><span style="font-size:9.0pt;Courier New&quot;;
color:#666600;">()</span><span style="font-size:9.0pt;Courier New&quot;;color:#666600;">{</span><span style="font-size:9.0pt;Courier New&quot;;
color:#666600;">...</span><span style="font-size:
9.0pt;Courier New&quot;;color:#666600;">}</span><br />
			<span style="font-size:9.0pt;Courier New&quot;;color:black;"> </span>&nbsp;<span style="font-size:9.0pt;Courier New&quot;;
color:#000088;">void</span><span style="font-size:9.0pt;Courier New&quot;;
color:black;"> set_song_name</span><span style="font-size:9.0pt;Courier New&quot;;
color:#666600;">(</span><span style="font-size:
9.0pt;Courier New&quot;;color:#000088;">const</span><span style="font-size:9.0pt;Courier New&quot;;color:#000088;">string</span><span style="font-size:9.0pt;Courier New&quot;;
color:#666600;">&amp;</span><span style="font-size:9.0pt;Courier New&quot;;
color:black;"> x</span><span style="font-size:
9.0pt;Courier New&quot;;color:#666600;">)</span><span style="font-size:9.0pt;Courier New&quot;;color:#666600;">{</span><span style="font-size:
9.0pt;Courier New&quot;;color:#666600;">...</span><span style="font-size:9.0pt;Courier New&quot;;color:#666600;">}</span></p>
<p>			<span style="font-size:9.0pt;Courier New&quot;;color:black;"> </span><span style="font-size:9.0pt;Courier New&quot;;color:black;">Java</span><span style="font-size:9.0pt;Courier New&quot;;
color:#666600;">:</span><br />
			<span style="font-size:
9.0pt;Courier New&quot;;color:black;"> </span>&nbsp;<span style="font-size:9.0pt;Courier New&quot;;
color:#000088;">public</span><span style="font-size:9.0pt;Courier New&quot;;
color:black;"> String getSongName</span><span style="font-size:9.0pt;Courier New&quot;;
color:#666600;">()</span><span style="font-size:9.0pt;Courier New&quot;;color:#666600;">{</span><span style="font-size:9.0pt;Courier New&quot;;
color:#666600;">...</span><span style="font-size:
9.0pt;Courier New&quot;;color:#666600;">}</span><br />
			<span style="font-size:9.0pt;Courier New&quot;;color:black;"> </span>&nbsp;<span style="font-size:9.0pt;Courier New&quot;;
color:#000088;">public</span><span style="font-size:9.0pt;Courier New&quot;;
color:black;"> Builder setSongName</span><span style="font-size:9.0pt;Courier New&quot;;
color:#666600;">(</span><span style="font-size:
9.0pt;Courier New&quot;;color:black;">String v</span><span style="font-size:9.0pt;Courier New&quot;;color:#666600;">)</span><span style="font-size:9.0pt;Courier New&quot;;
color:#666600;">{</span><span style="font-size:9.0pt;Courier New&quot;;color:#666600;">...</span><span style="font-size:9.0pt;Courier New&quot;;
color:#666600;">}</span></font></div>
</p></div>
<div style="border:none;border-top:solid #3366CC 1.0pt;padding:1.0pt 0cm 0cm 0cm;background:
#E5ECF9;margin-left:-7.5pt;margin-right:0cm"></p>
<div align="left" style="margin-top:24.0pt;text-align:left;background:#E5ECF9;border:none;padding:0cm;">
			<font class="Apple-style-span" color="#000000" size="7"><b><span style="font-size:15.0pt;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;">Enums </span></b><b><span style="font-size:
15.0pt;color:blue;">枚举</span></b></font></div>
</p></div>
<div align="left" style="text-align:left;line-height:15.0pt;">
		<font class="Apple-style-span" color="#000000" size="7"><span style="font-size:12.0pt;Helvetica&quot;,&quot;sans-serif&quot;;color:black;">Use CamelCase (with an initial capital) for enum type names and CAPITALS_WITH_UNDERSCORES for value names:</span></font></div>
<div align="left" style="text-align:left;line-height:15.0pt;">
		<font class="Apple-style-span" color="#000000" size="7"><b><span style="font-size:12.0pt;color:blue;">枚举名使用驼峰格式（每个单词首字母大写）来书写，值名使用大写的下划线分隔式（</span></b><span style="font-size:12.0pt;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;">CAPITALS_WITH_UNDERSCORES</span><b><span style="font-size:12.0pt;color:blue;">）来书写：</span></b></font></div>
<div style="border:solid #BBBBBB 1.0pt;padding:12.0pt 12.0pt 12.0pt 12.0pt;background:#FAFAFA">
<div align="left" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;
background:#FAFAFA;border:none;padding:0cm;"><br />
			<font class="Apple-style-span" color="#000000" size="7"><span style="font-size:
9.0pt;Courier New&quot;;color:#000088;">enum</span><span style="font-size:9.0pt;Courier New&quot;;color:black;"> Foo </span><span style="font-size:9.0pt;Courier New&quot;;color:#666600;">{</span><br />
			<span style="font-size:9.0pt;Courier New&quot;;color:black;"> </span><span style="font-size:9.0pt;Courier New&quot;;color:black;">&nbsp; FIRST_VALUE </span><span style="font-size:9.0pt;Courier New&quot;;
color:#666600;">=</span><span style="font-size:9.0pt;Courier New&quot;;color:#006666;">1</span><span style="font-size:9.0pt;Courier New&quot;;color:#666600;">;</span><br />
			<span style="font-size:9.0pt;Courier New&quot;;color:black;"> </span><span style="font-size:9.0pt;Courier New&quot;;color:black;">&nbsp; SECOND_VALUE </span><span style="font-size:9.0pt;Courier New&quot;;color:#666600;">=</span><span style="font-size:
9.0pt;Courier New&quot;;color:#006666;">2</span><span style="font-size:9.0pt;Courier New&quot;;color:#666600;">;</span><br />
			<span style="font-size:9.0pt;Courier New&quot;;
color:black;"> </span><span style="font-size:9.0pt;Courier New&quot;;color:#666600;">}</span></font></div>
</p></div>
<div align="left" style="text-align:left;line-height:15.0pt;">
		<font class="Apple-style-span" color="#000000" size="7"><span style="font-size:12.0pt;Helvetica&quot;,&quot;sans-serif&quot;;color:black;">Each enum value should end with a semicolon, not a comma.</span></font></div>
<div align="left" style="text-align:left;line-height:15.0pt;">
		<font class="Apple-style-span" color="#000000" size="7"><b><span style="font-size:12.0pt;color:blue;">每一个枚举值都应该以分号结尾，而不是逗号。</span></b></font></div>
<div align="left" style="text-align:left;line-height:15.0pt;">
		<span style="color: rgb(255, 255, 255); font-family: arial, helvetica, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a></div>
<div style="border:none;border-top:solid #3366CC 1.0pt;padding:1.0pt 0cm 0cm 0cm;background:
#E5ECF9;margin-left:-7.5pt;margin-right:0cm"></p>
<div align="left" style="margin-top:24.0pt;text-align:left;background:#E5ECF9;border:none;padding:0cm;">
			<font class="Apple-style-span" color="#000000" size="7"><b><span style="font-size:15.0pt;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;">Services </span></b><b><span style="font-size:15.0pt;color:blue;">服务</span></b></font></div>
</p></div>
<div align="left" style="text-align:left;line-height:15.0pt;">
		<font class="Apple-style-span" color="#000000" size="7"><span style="font-size:12.0pt;Helvetica&quot;,&quot;sans-serif&quot;;color:black;">If your&nbsp;</span><span style="font-size:10.0pt;Courier New&quot;;color:#007000;">.proto</span><span style="font-size:12.0pt;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;">&nbsp;defines an RPC service, you should use CamelCase (with an initial capital) for both the service name and any RPC method names:</span></font></div>
<div align="left" style="text-align:left;line-height:15.0pt;">
		<font class="Apple-style-span" color="#000000" size="7"><b><span style="font-size:12.0pt;color:blue;">如果你的</span></b><b><span style="font-size:12.0pt;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;">.proto</span></b><b><span style="font-size:12.0pt;
color:blue;">文件定义了一个</span></b><b><span style="font-size:12.0pt;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;">RPC</span></b><b><span style="font-size:12.0pt;
color:blue;">服务，那么服务名和任何</span></b><b><span style="font-size:12.0pt;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;">RPC</span></b><b><span style="font-size:12.0pt;
color:blue;">函数名都应该使用驼峰格式（每个单词首字母大写）来书写：</span></b></font></div>
<div style="border:solid #BBBBBB 1.0pt;padding:12.0pt 12.0pt 12.0pt 12.0pt;background:#FAFAFA">
<div align="left" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;
background:#FAFAFA;border:none;padding:0cm;"><br />
			<font class="Apple-style-span" color="#000000" size="7"><span style="font-size:
9.0pt;Courier New&quot;;color:#007000;">service FooService {</span></font></div>
<div align="left" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;
background:#FAFAFA;border:none;padding:0cm;"><br />
			<font class="Apple-style-span" color="#000000" size="7"><span style="font-size:
9.0pt;Courier New&quot;;color:#007000;">&nbsp;rpc GetSomething(FooRequest) returns (FooResponse);</span></font></div>
<div align="left" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;
background:#FAFAFA;border:none;padding:0cm;"><br />
			<font class="Apple-style-span" color="#000000" size="7"><span style="font-size:
9.0pt;Courier New&quot;;color:#007000;">}</span></font></div>
</p></div>
</div>
<div align="left" style="margin-left:-7.5pt;text-align:left;
line-height:26.25pt;"><br />
	<br />
	<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
	<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;版权声明&nbsp;<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;<br />
	转载需注明出处：<u><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><em><span style="color: rgb(0, 0, 255);"><strong style="font-size: 16px;"><span style="font-family: arial, helvetica, sans-serif;">codelast.com</span></strong></span></em></a></u>&nbsp;<br />
	感谢关注我的微信公众号（微信扫一扫）：</p>
<p style="border: 0px; font-size: 13px; margin: 0px 0px 9px; outline: 0px; padding: 0px; color: rgb(77, 77, 77);">
		<img decoding="async" alt="wechat qrcode of codelast" src="https://www.codelast.com/codelast_wechat_qr_code.jpg" style="width: 200px; height: 200px;" /></p>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codelast.com/%e5%8e%9f%e5%88%9b-style-guide%e4%b8%ad%e6%96%87%e7%bf%bb%e8%af%91%ef%bc%88google-protocol-buffers%e4%b8%ad%e6%96%87%e6%95%99%e7%a8%8b%ef%bc%89/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[原创] Language Guide中文翻译（Google Protocol Buffers中文教程）</title>
		<link>https://www.codelast.com/%e5%8e%9f%e5%88%9b-language-guide%e4%b8%ad%e6%96%87%e7%bf%bb%e8%af%91%ef%bc%88google-protocol-buffers%e4%b8%ad%e6%96%87%e6%95%99%e7%a8%8b%ef%bc%89/</link>
					<comments>https://www.codelast.com/%e5%8e%9f%e5%88%9b-language-guide%e4%b8%ad%e6%96%87%e7%bf%bb%e8%af%91%ef%bc%88google-protocol-buffers%e4%b8%ad%e6%96%87%e6%95%99%e7%a8%8b%ef%bc%89/#respond</comments>
		
		<dc:creator><![CDATA[learnhard]]></dc:creator>
		<pubDate>Tue, 14 Sep 2010 05:22:37 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[Buffer]]></category>
		<category><![CDATA[Google Protocol Buffers]]></category>
		<category><![CDATA[Language Guide]]></category>
		<category><![CDATA[Protocol]]></category>
		<category><![CDATA[Protocol Buffer]]></category>
		<category><![CDATA[Protocol Buffers]]></category>
		<category><![CDATA[中文]]></category>
		<category><![CDATA[教程]]></category>
		<category><![CDATA[翻译]]></category>
		<guid isPermaLink="false">http://www.codelast.com/?p=299</guid>

					<description><![CDATA[<h1>
	<b><span lang="EN-US" style="font-size:20.5pt;font-family:&#34;Helvetica&#34;,&#34;sans-serif&#34;;
color:black;mso-font-kerning:18.0pt">Language Guide </span></b><b><span style="font-size:20.5pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:18.0pt">语言指南</span></b></h1>
<p align="left" class="MsoNormal" style="margin-left:-7.5pt;text-align:left;
line-height:26.25pt;mso-pagination:widow-orphan;mso-outline-level:1"><br />
	注：这是本人的翻译，可能不准确，可能有错误，但是基本上可以理解，希望能对大家有所帮助！（<strong><span style="color:#ff0000;">转载须注明出处</span></strong>：本文来自learnhard的博客：<span style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; color: rgb(0, 0, 255); "><a href="http://www.codelast.com/" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: rgb(0, 77, 153); border-style: initial; border-color: initial; border-style: initial; border-color: initial; " target="_blank" rel="noopener noreferrer">http://www.codelast.com/</a>&#160;</span>&#38;&#160;<a href="http://blog.csdn.net/learnhard/" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: rgb(0, 77, 153); border-style: initial; border-color: initial; border-style: initial; border-color: initial; "><span style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; color: rgb(0, 0, 255); ">http://blog.csdn.net/learnhard/</span></a>）</p>
<p align="left" class="MsoNormal" style="margin-left:-7.5pt;text-align:left;
line-height:26.25pt;mso-pagination:widow-orphan;mso-outline-level:1"><br />
<span id="more-299"></span></p>
<p align="left" class="MsoNormal" style="margin-left:-7.5pt;text-align:left;
line-height:26.25pt;mso-pagination:widow-orphan;mso-outline-level:1"><br />
	<b><span lang="EN-US" style="font-size:
20.5pt;font-family:&#34;Helvetica&#34;,&#34;sans-serif&#34;;color:black;mso-font-kerning:18.0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l13 level1 lfo1;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&#183;<span style="font:7.0pt &#34;Times New Roman&#34;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&#34;Helvetica&#34;,&#34;sans-serif&#34;;color:black;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html#simple"><span style="color:#0000CC">Defining A Message Type</span></a><o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l13 level1 lfo1;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&#183;<span style="font:7.0pt &#34;Times New Roman&#34;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&#34;Helvetica&#34;,&#34;sans-serif&#34;;color:black;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html#scalar"><span style="color:#0000CC">Scalar Value Types</span></a><o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l13 level1 lfo1;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&#183;<span style="font:7.0pt &#34;Times New Roman&#34;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&#34;Helvetica&#34;,&#34;sans-serif&#34;;color:black;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html#optional"><span style="color:#0000CC">Optional And Default Values</span></a><o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l13 level1 lfo1;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&#183;<span style="font:7.0pt &#34;Times New Roman&#34;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&#34;Helvetica&#34;,&#34;sans-serif&#34;;color:black;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html#enum"><span style="color:#0000CC">Enumerations</span></a><o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l13 level1 lfo1;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&#183;<span style="font:7.0pt &#34;Times New Roman&#34;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&#34;Helvetica&#34;,&#34;sans-serif&#34;;color:black;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html#other"><span style="color:#0000CC">Using Other Message Types</span></a><o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l13 level1 lfo1;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&#183;<span style="font:7.0pt &#34;Times New Roman&#34;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&#34;Helvetica&#34;,&#34;sans-serif&#34;;color:black;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html#nested"><span style="color:#0000CC">Nested Types</span></a><o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l13 level1 lfo1;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&#183;<span style="font:7.0pt &#34;Times New Roman&#34;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&#34;Helvetica&#34;,&#34;sans-serif&#34;;color:black;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html#updating"><span style="color:#0000CC">Updating A Message Type</span></a><o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l13 level1 lfo1;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&#183;<span style="font:7.0pt &#34;Times New Roman&#34;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&#34;Helvetica&#34;,&#34;sans-serif&#34;;color:black;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html#extensions"><span style="color:#0000CC">Extensions</span></a><o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l13 level1 lfo1;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&#183;<span style="font:7.0pt &#34;Times New Roman&#34;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&#34;Helvetica&#34;,&#34;sans-serif&#34;;color:black;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html#packages"><span style="color:#0000CC">Packages</span></a><o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l13 level1 lfo1;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&#183;<span style="font:7.0pt &#34;Times New Roman&#34;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&#34;Helvetica&#34;,&#34;sans-serif&#34;;color:black;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html#services"><span style="color:#0000CC">Defining Services</span></a><o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l13 level1 lfo1;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&#183;<span style="font:7.0pt &#34;Times New Roman&#34;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&#34;Helvetica&#34;,&#34;sans-serif&#34;;color:black;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html#options"><span style="color:#0000CC">Options</span></a><o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l13 level1 lfo1;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&#183;<span style="font:7.0pt &#34;Times New Roman&#34;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&#34;Helvetica&#34;,&#34;sans-serif&#34;;color:black;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html#generating"><span style="color:#0000CC">Generating Your Classes</span></a><o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&#34;Helvetica&#34;,&#34;sans-serif&#34;;color:black;mso-font-kerning:0pt">This guide describes how to use the protocol buffer language to structure your protocol buffer data, including&#160;</span><span lang="EN-US" style="font-size:
10.0pt;mso-bidi-font-size:11.0pt;font-family:&#34;Courier New&#34;;color:#007000;
mso-font-kerning:0pt">.proto</span>&#8230; <a href="https://www.codelast.com/%e5%8e%9f%e5%88%9b-language-guide%e4%b8%ad%e6%96%87%e7%bf%bb%e8%af%91%ef%bc%88google-protocol-buffers%e4%b8%ad%e6%96%87%e6%95%99%e7%a8%8b%ef%bc%89/" class="read-more">Read More </a></p>]]></description>
										<content:encoded><![CDATA[<h1>
	<b><span lang="EN-US" style="font-size:20.5pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:18.0pt">Language Guide </span></b><b><span style="font-size:20.5pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:18.0pt">语言指南</span></b></h1>
<p align="left" class="MsoNormal" style="margin-left:-7.5pt;text-align:left;
line-height:26.25pt;mso-pagination:widow-orphan;mso-outline-level:1"><br />
	注：这是本人的翻译，可能不准确，可能有错误，但是基本上可以理解，希望能对大家有所帮助！（<strong><span style="color:#ff0000;">转载须注明出处</span></strong>：本文来自learnhard的博客：<span style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; color: rgb(0, 0, 255); "><a href="http://www.codelast.com/" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: rgb(0, 77, 153); border-style: initial; border-color: initial; border-style: initial; border-color: initial; " target="_blank" rel="noopener noreferrer">http://www.codelast.com/</a>&nbsp;</span>&amp;&nbsp;<a href="http://blog.csdn.net/learnhard/" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: rgb(0, 77, 153); border-style: initial; border-color: initial; border-style: initial; border-color: initial; "><span style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; color: rgb(0, 0, 255); ">http://blog.csdn.net/learnhard/</span></a>）</p>
<p align="left" class="MsoNormal" style="margin-left:-7.5pt;text-align:left;
line-height:26.25pt;mso-pagination:widow-orphan;mso-outline-level:1"><br />
<span id="more-299"></span></p>
<p align="left" class="MsoNormal" style="margin-left:-7.5pt;text-align:left;
line-height:26.25pt;mso-pagination:widow-orphan;mso-outline-level:1"><br />
	<b><span lang="EN-US" style="font-size:
20.5pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:18.0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l13 level1 lfo1;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html#simple"><span style="color:#0000CC">Defining A Message Type</span></a><o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l13 level1 lfo1;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html#scalar"><span style="color:#0000CC">Scalar Value Types</span></a><o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l13 level1 lfo1;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html#optional"><span style="color:#0000CC">Optional And Default Values</span></a><o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l13 level1 lfo1;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html#enum"><span style="color:#0000CC">Enumerations</span></a><o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l13 level1 lfo1;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html#other"><span style="color:#0000CC">Using Other Message Types</span></a><o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l13 level1 lfo1;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html#nested"><span style="color:#0000CC">Nested Types</span></a><o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l13 level1 lfo1;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html#updating"><span style="color:#0000CC">Updating A Message Type</span></a><o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l13 level1 lfo1;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html#extensions"><span style="color:#0000CC">Extensions</span></a><o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l13 level1 lfo1;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html#packages"><span style="color:#0000CC">Packages</span></a><o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l13 level1 lfo1;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html#services"><span style="color:#0000CC">Defining Services</span></a><o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l13 level1 lfo1;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html#options"><span style="color:#0000CC">Options</span></a><o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l13 level1 lfo1;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html#generating"><span style="color:#0000CC">Generating Your Classes</span></a><o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">This guide describes how to use the protocol buffer language to structure your protocol buffer data, including&nbsp;</span><span lang="EN-US" style="font-size:
10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;
mso-font-kerning:0pt">.proto</span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">&nbsp;file syntax and how to generate data access classes from your&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">.proto</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;files.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">This is a reference guide &ndash; for a step by step example that uses many of the features described in this document, see the&nbsp;<a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/tutorials.html"><span style="color:#0000CC">tutorial</span></a>&nbsp;for your chosen language.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><o:p>&nbsp;</o:p></span><span lang="EN-US" style="line-height: 26.25pt; text-indent: -21pt; font-size: 12pt; font-family: Wingdings; color: blue; ">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span><b style="line-height: 26.25pt; text-indent: -21pt; "><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">定义一个消息（</span></b><b style="line-height: 26.25pt; text-indent: -21pt; "><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">message</span></b><b style="line-height: 26.25pt; text-indent: -21pt; "><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">）类型</span></b></p>
<p align="left" class="MsoNormal" style="margin-left:21.0pt;text-align:left;
text-indent:-21.0pt;line-height:26.25pt;mso-pagination:widow-orphan;mso-outline-level:
1;mso-list:l0 level1 lfo8"><br />
	<span lang="EN-US" style="font-size:12.0pt;mso-bidi-font-size:20.5pt;font-family:Wingdings;
mso-fareast-font-family:Wingdings;mso-bidi-font-family:Wingdings;color:blue;
mso-font-kerning:18.0pt;mso-bidi-font-weight:bold"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">标量值类型</span></b><b><span lang="EN-US" style="font-size:20.5pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;
mso-font-kerning:18.0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-left:21.0pt;text-align:left;
text-indent:-21.0pt;line-height:26.25pt;mso-pagination:widow-orphan;mso-outline-level:
1;mso-list:l0 level1 lfo8"><br />
	<span lang="EN-US" style="font-size:12.0pt;mso-bidi-font-size:20.5pt;font-family:Wingdings;
mso-fareast-font-family:Wingdings;mso-bidi-font-family:Wingdings;color:blue;
mso-font-kerning:18.0pt;mso-bidi-font-weight:bold"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">可选的（</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">optional</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">）字段以及默认值</span></b><b><span lang="EN-US" style="font-size:20.5pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;
mso-font-kerning:18.0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-left:21.0pt;text-align:left;
text-indent:-21.0pt;line-height:26.25pt;mso-pagination:widow-orphan;mso-outline-level:
1;mso-list:l0 level1 lfo8"><br />
	<span lang="EN-US" style="font-size:12.0pt;mso-bidi-font-size:20.5pt;font-family:Wingdings;
mso-fareast-font-family:Wingdings;mso-bidi-font-family:Wingdings;color:blue;
mso-font-kerning:18.0pt;mso-bidi-font-weight:bold"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">枚举</span></b><b><span lang="EN-US" style="font-size:20.5pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;
mso-font-kerning:18.0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-left:21.0pt;text-align:left;
text-indent:-21.0pt;line-height:26.25pt;mso-pagination:widow-orphan;mso-outline-level:
1;mso-list:l0 level1 lfo8"><br />
	<span lang="EN-US" style="font-size:12.0pt;mso-bidi-font-size:20.5pt;font-family:Wingdings;
mso-fareast-font-family:Wingdings;mso-bidi-font-family:Wingdings;color:blue;
mso-font-kerning:18.0pt;mso-bidi-font-weight:bold"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">使用其他消息类型</span></b><b><span lang="EN-US" style="font-size:20.5pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:18.0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-left:21.0pt;text-align:left;
text-indent:-21.0pt;line-height:26.25pt;mso-pagination:widow-orphan;mso-outline-level:
1;mso-list:l0 level1 lfo8"><br />
	<span lang="EN-US" style="font-size:12.0pt;mso-bidi-font-size:20.5pt;font-family:Wingdings;
mso-fareast-font-family:Wingdings;mso-bidi-font-family:Wingdings;color:blue;
mso-font-kerning:18.0pt;mso-bidi-font-weight:bold"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">嵌套类型</span></b><b><span lang="EN-US" style="font-size:20.5pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;
mso-font-kerning:18.0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-left:21.0pt;text-align:left;
text-indent:-21.0pt;line-height:26.25pt;mso-pagination:widow-orphan;mso-outline-level:
1;mso-list:l0 level1 lfo8"><br />
	<span lang="EN-US" style="font-size:12.0pt;mso-bidi-font-size:20.5pt;font-family:Wingdings;
mso-fareast-font-family:Wingdings;mso-bidi-font-family:Wingdings;color:blue;
mso-font-kerning:18.0pt;mso-bidi-font-weight:bold"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">更新一个消息类型</span></b><b><span lang="EN-US" style="font-size:20.5pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:18.0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-left:21.0pt;text-align:left;
text-indent:-21.0pt;line-height:26.25pt;mso-pagination:widow-orphan;mso-outline-level:
1;mso-list:l0 level1 lfo8"><br />
	<span lang="EN-US" style="font-size:12.0pt;mso-bidi-font-size:20.5pt;font-family:Wingdings;
mso-fareast-font-family:Wingdings;mso-bidi-font-family:Wingdings;color:blue;
mso-font-kerning:18.0pt;mso-bidi-font-weight:bold"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">扩展</span></b><b><span lang="EN-US" style="font-size:20.5pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;
mso-font-kerning:18.0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-left:21.0pt;text-align:left;
text-indent:-21.0pt;line-height:26.25pt;mso-pagination:widow-orphan;mso-outline-level:
1;mso-list:l0 level1 lfo8"><br />
	<span lang="EN-US" style="font-size:12.0pt;mso-bidi-font-size:20.5pt;font-family:Wingdings;
mso-fareast-font-family:Wingdings;mso-bidi-font-family:Wingdings;color:blue;
mso-font-kerning:18.0pt;mso-bidi-font-weight:bold"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">包（</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">package</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">）</span></b><b><span lang="EN-US" style="font-size:20.5pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;
mso-font-kerning:18.0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-left:21.0pt;text-align:left;
text-indent:-21.0pt;line-height:26.25pt;mso-pagination:widow-orphan;mso-outline-level:
1;mso-list:l0 level1 lfo8"><br />
	<span lang="EN-US" style="font-size:12.0pt;mso-bidi-font-size:20.5pt;font-family:Wingdings;
mso-fareast-font-family:Wingdings;mso-bidi-font-family:Wingdings;color:blue;
mso-font-kerning:18.0pt;mso-bidi-font-weight:bold"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">定义服务（</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">service</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">）</span></b><b><span lang="EN-US" style="font-size:20.5pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;
mso-font-kerning:18.0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-left:21.0pt;text-align:left;
text-indent:-21.0pt;line-height:26.25pt;mso-pagination:widow-orphan;mso-outline-level:
1;mso-list:l0 level1 lfo8"><br />
	<span lang="EN-US" style="font-size:12.0pt;mso-bidi-font-size:20.5pt;font-family:Wingdings;
mso-fareast-font-family:Wingdings;mso-bidi-font-family:Wingdings;color:blue;
mso-font-kerning:18.0pt;mso-bidi-font-weight:bold"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">选项（</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">option</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">）</span></b><b><span lang="EN-US" style="font-size:20.5pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;
mso-font-kerning:18.0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-left:21.0pt;text-align:left;
text-indent:-21.0pt;line-height:26.25pt;mso-pagination:widow-orphan;mso-outline-level:
1;mso-list:l0 level1 lfo8"><br />
	<span lang="EN-US" style="font-size:12.0pt;mso-bidi-font-size:20.5pt;font-family:Wingdings;
mso-fareast-font-family:Wingdings;mso-bidi-font-family:Wingdings;color:blue;
mso-font-kerning:18.0pt;mso-bidi-font-weight:bold"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">生成访问类</span></b><b><span lang="EN-US" style="font-size:20.5pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;
mso-font-kerning:18.0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-left:-7.5pt;text-align:left;
line-height:26.25pt;mso-pagination:widow-orphan;mso-outline-level:1"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">本指南描述了怎样使用</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">protocol buffer</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:
12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:
Helvetica;mso-bidi-font-family:Helvetica;color:blue;mso-font-kerning:0pt">语言来构造你的</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">protocol buffer</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:
12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:
Helvetica;mso-bidi-font-family:Helvetica;color:blue;mso-font-kerning:0pt">数据，包括</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">.proto</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">文件语法以及怎样生成</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">.proto</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">文件的数据访问类。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-left:-7.5pt;text-align:left;
line-height:26.25pt;mso-pagination:widow-orphan;mso-outline-level:1"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">本文是一个参考指南&mdash;&mdash;如果要查看如何使用本文中描述的多个特性的循序渐进的例子，请在</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/tutorials.html"><span style="color:#0000CC">tutorial</span></a></span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">中查找你需要的语言的教程。</span></b></p>
<div style="mso-element:para-border-div;border:none;border-top:solid #3366CC 1.0pt;
mso-border-top-alt:solid #3366CC .75pt;padding:1.0pt 0cm 0cm 0cm;background:
#E5ECF9;margin-left:-7.5pt;margin-right:0cm"></p>
<p align="left" class="MsoNormal" style="margin-top:24.0pt;text-align:left;
mso-pagination:widow-orphan;mso-outline-level:2;background:#E5ECF9;border:none;
mso-border-top-alt:solid #3366CC .75pt;padding:0cm;mso-padding-alt:1.0pt 0cm 0cm 0cm"><br />
		<b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">Defining A Message Type </span></b><b><span style="font-size:15.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">定义一个消息类型</span></b><b><span lang="EN-US" style="font-size:
15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
</div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">First let&#39;s look at a very simple example. Let&#39;s say you want to define a search request message format, where each search request has a query string, the particular page of results you are interested in, and a number of results per page. Here&#39;s the&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">.proto</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;file you use to define the message type.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">首先看一个非常简单的例子。假设你想定义一个&ldquo;搜索请求&rdquo;（</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">search request</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">）的消息格式，每一个搜索请求含有一个查询字符串、你感兴趣的查询结果所在的页数，以及每一页多少条查询结果。那么下面这个就是用来定义消息类型的</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">.proto</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">文件了：</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<div style="mso-element:para-border-div;border:solid #BBBBBB 1.0pt;mso-border-alt:
solid #BBBBBB .75pt;padding:12.0pt 12.0pt 12.0pt 12.0pt;background:#FAFAFA"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">message SearchRequest {<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>required string query = 1;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>optional int32 page_number = 2;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>optional int32 result_per_page = 3;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">}<o:p></o:p></span></p>
</div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">The&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">SearchRequest</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;message definition specifies three fields (name/value pairs), one for each piece of data that you want to include in this type of message. Each field has a name and a type.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">SearchRequest</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">消息类型指定了</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">3</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">个字段（名</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">/</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">值</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"> </span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">对），你想在消息中承载的数据分别对应于每一个字段。每个字段都有一个名字（</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">name</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">）和一个类型（</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">type</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">）。</span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span style="color: rgb(255, 255, 255); font-family: arial, helvetica, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b><span lang="EN-US" style="font-size: 15pt; font-family: Helvetica, sans-serif; ">Specifying Field Types </span></b><b><span style="font-size:15.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">指定字段类型</span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">In the above example, all the fields are&nbsp;<a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html#scalar"><span style="color:#0000CC">scalar types</span></a>: two integers (</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">page_number</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;and&nbsp;</span><span lang="EN-US" style="font-size:
10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;
mso-font-kerning:0pt">result_per_page</span><span lang="EN-US" style="font-size:
12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">) and a string (</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">query</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">). However, you can also specify composite types for your fields, including&nbsp;<a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html#enum"><span style="color:#0000CC">enumerations</span></a>&nbsp;and other message types.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">在上面的例子中，所有字段都是标量类型（</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html#scalar"><span style="color:#0000CC">scalar types</span></a></span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">）</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">:</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">两个整型（</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">page_number</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">和</span></b><span lang="EN-US" style="font-size:
10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;
mso-font-kerning:0pt">result_per_page</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">），一个</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">string</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">（</span></b><span lang="EN-US" style="font-size:
10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;
mso-font-kerning:0pt">query</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">）。然而，你也可以为字段指定合成的类型，包括枚举（</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html#enum"><span style="color:#0000CC">enumerations</span></a></span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">）以及其他消息类型。</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-top:18.0pt;text-align:left;
mso-pagination:widow-orphan;mso-outline-level:3"><br />
	<b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">Assigning Tags </span></b><b><span style="font-size:15.0pt;
font-family:宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;
mso-bidi-font-family:Helvetica;color:blue;mso-font-kerning:0pt">分配标识号</span></b><b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">As you can see, each field in the message definition has a&nbsp;<b>unique numbered tag</b>. These tags are used to identify your fields in the&nbsp;<a href="http://code.google.com/apis/protocolbuffers/docs/encoding.html"><span style="color:#0000CC">message binary format</span></a>, and should not be changed once your message type is in use. Note that tags with values in the range 1 through 15 take one byte to encode. Tags in the range 16 through 2047 take two bytes. So you should reserve the tags 1 through 15 for very frequently occurring message elements. Remember to leave some room for frequently occurring elements that might be added in the future.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">The smallest tag number you can specify is 1, and the largest is 2<sup>29</sup>&nbsp;- 1, or 536,870,911. You also cannot use the numbers 19000 though 19999 (</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">FieldDescriptor::kFirstReservedNumber</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;through&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">FieldDescriptor::kLastReservedNumber</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">), as they are reserved for the Protocol Buffers implementation - the protocol buffer compiler will complain if you use one of these reserved numbers in your&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">.proto</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">如你所见，在消息定义中，每一个字段都有一个</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#FF0066;mso-font-kerning:0pt">独一无二的标识号</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">（</span></b><b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">unique numbered tag</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">）。这些标识号是用来在</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#FF0066;mso-font-kerning:0pt">消息二进制格式</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">（</span></b><span lang="EN-US" style="font-size:
12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><a href="http://code.google.com/apis/protocolbuffers/docs/encoding.html"><span style="color:#0000CC">message binary format</span></a></span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">）中识别你的字段的。注意：</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">[1,15]</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">之内的标识号在编码的时候会占用一个字节。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">[16,2047]</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">之内的标识号则占用</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">2</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">个字节。所以你应该为那些频繁出现的消息元素保留</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">[1,15]</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">之内的标识号。切记：要为将来有可能添加的、频繁出现的标识号预留一些标识号。</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt"><o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:18.0pt;text-align:left;
mso-pagination:widow-orphan;mso-outline-level:3"><br />
	<b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">Specifying Field Rules </span></b><b><span style="font-size:15.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">指定字段规则</span></b><b><span lang="EN-US" style="font-size:
15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">You specify that message fields are one of the following:<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l4 level1 lfo2;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">required</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">: a well-formed message must have exactly one of this field.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l4 level1 lfo2;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">optional</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">: a well-formed message can have zero or one of this field (but not more than one).<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l4 level1 lfo2;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">repeated</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">: this field can be repeated any number of times (including zero) in a well-formed message. The order of the repeated values will be preserved.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;text-align:left;
line-height:15.0pt;mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">你所指定的消息字段必须是如下之一：</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:21.0pt;margin-bottom:.0001pt;text-align:left;
text-indent:-21.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l1 level1 lfo10"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings;color:blue;mso-font-kerning:0pt"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">required</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">：一个格式良好的消息一定要含有</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">1</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">个这种字段。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:21.0pt;margin-bottom:.0001pt;text-align:left;
text-indent:-21.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l1 level1 lfo10"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings;color:blue;mso-font-kerning:0pt"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">optional</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">：一个格式良好的消息可以有</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">0</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">个或</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">1</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">个这种字段（但不超过</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">1</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">个）。</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:21.0pt;margin-bottom:.0001pt;text-align:left;
text-indent:-21.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l1 level1 lfo10"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings;color:blue;mso-font-kerning:0pt"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">repeated</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">：在一个格式良好的消息中，这种字段可以重复任意多次（包括</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">0</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">次）。重复的值的顺序会被保留。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;text-align:left;
line-height:15.0pt;mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">（译者注：这一段内容我不太理解，因为</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">Google</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">提供的</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">.proto</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">示例文件并没有按这个说法来编写</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">&hellip;</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">）</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;text-align:left;
line-height:15.0pt;mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p>&nbsp;</o:p></span></b><span lang="EN-US" style="line-height: 15pt; font-size: 12pt; font-family: Helvetica, sans-serif; ">For historical reasons,&nbsp;</span><span lang="EN-US" style="line-height: 15pt; font-size: 10pt; font-family: 'Courier New'; color: rgb(0, 112, 0); ">repeated</span><span lang="EN-US" style="line-height: 15pt; font-size: 12pt; font-family: Helvetica, sans-serif; ">&nbsp;fields of basic numeric types aren&#39;t encoded as efficiently as they could be. New code should use the special option&nbsp;</span><span lang="EN-US" style="line-height: 15pt; font-size: 10pt; font-family: 'Courier New'; color: rgb(0, 112, 0); ">[packed=true]</span><span lang="EN-US" style="line-height: 15pt; font-size: 12pt; font-family: Helvetica, sans-serif; ">&nbsp;to get a more efficient encoding. For example:</span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;text-align:left;
line-height:15.0pt;mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">由于历史原因，基本数值类型的</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">repeated</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">的字段并没有被尽可能地高效编码。在新的代码（译者注：这里是指</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">.proto</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">文件的内容）中，用户应该使用特殊选项</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">[packed=true]</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">来保证更高效的编码。例如：</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<div style="mso-element:para-border-div;border:solid #BBBBBB 1.0pt;mso-border-alt:
solid #BBBBBB .75pt;padding:12.0pt 12.0pt 12.0pt 12.0pt;background:#FAFAFA"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">repeated int32 samples = 4 [packed=true];<o:p></o:p></span></p>
</div>
<div style="mso-element:para-border-div;border-top:solid #FFCC33 1.0pt;
border-left:none;border-bottom:solid #FFCC33 1.0pt;border-right:none;
mso-border-top-alt:solid #FFCC33 .75pt;mso-border-bottom-alt:solid #FFCC33 .75pt;
padding:2.0pt 0cm 2.0pt 0cm;background:#EFEFEF"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:15.0pt;mso-pagination:widow-orphan;background:#EFEFEF;border:none;
mso-border-top-alt:solid #FFCC33 .75pt;mso-border-bottom-alt:solid #FFCC33 .75pt;
padding:0cm;mso-padding-alt:2.0pt 0cm 2.0pt 0cm"><br />
		<b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">Required Is Forever</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;You should be very careful about marking fields as&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">required</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">. If at some point you wish to stop writing or sending a required field, it will be problematic to change the field to an optional field &ndash; old readers will consider messages without this field to be incomplete and may reject or drop them unintentionally. You should consider writing application-specific custom validation routines for your buffers instead. Some engineers at Google have come to the conclusion that using&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">required</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;does more harm than good; they prefer to use only</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">optional</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;and&nbsp;</span><span lang="EN-US" style="font-size:
10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;
mso-font-kerning:0pt">repeated</span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">. However, this view is not universal.<o:p></o:p></span></p>
</div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">required</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">是永久性的：在把一个字段标识为</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">required</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">的时候，你应该特别小心。如果在某些情况下你不想写入或者发送一个</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">required</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">的字段，那么将该字段更改为</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">optional</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">可能会遇到问题&mdash;&mdash;旧版本的读者（译者注：即读取、解析消息的一方）会认为不含该字段的消息（</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">message</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">）是不完整的，从而有可能会拒绝解析。在这种情况下，你应该考虑编写特别针对于应用程序的、自定义的消息校验函数。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">Google</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">的一些工程师得出了一个结论：使用</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">required</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">弊多于利；他们更愿意使用</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">optional</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">和</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">repeated</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">而不是</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">required</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">。当然，这个观点并不具有普遍性。</span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span style="color: rgb(255, 255, 255); font-family: arial, helvetica, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span>&nbsp;</b><b><span lang="EN-US" style="font-size: 15pt; font-family: Helvetica, sans-serif; ">Adding More Message Types </span></b><b><span style="font-size:15.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">添加更多消息类型</span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">Multiple message types can be defined in a single&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">.proto</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;file. This is useful if you are defining multiple related messages &ndash; so, for example, if you wanted to define the reply message format that corresponds to your&nbsp;</span><span lang="EN-US" style="font-size:
10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;
mso-font-kerning:0pt">SearchResponse</span><span lang="EN-US" style="font-size:
12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">&nbsp;message type, you could add it to the same&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">.proto</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">:<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">在一个</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">.proto</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">文件中可以定义多个消息类型。在定义多个相关的消息的时候，这一点特别有用&mdash;&mdash;例如，如果你想定义与你的</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">SearchResponse</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">消息类型对应的回复消息格式的话，你可以将它添加到相同的</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">.proto</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">文件中：</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt"><o:p></o:p></span></p>
<div style="mso-element:para-border-div;border:solid #BBBBBB 1.0pt;mso-border-alt:
solid #BBBBBB .75pt;padding:12.0pt 12.0pt 12.0pt 12.0pt;background:#FAFAFA"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">message SearchRequest {<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>required string query = 1;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>optional int32 page_number = 2;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>optional int32 result_per_page = 3;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">}<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><o:p>&nbsp;</o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">message SearchResponse {<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp;</span>...<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">}<o:p></o:p></span></p>
</div>
<p align="left" class="MsoNormal" style="margin-top:18.0pt;text-align:left;
mso-pagination:widow-orphan;mso-outline-level:3"><br />
	<b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">Adding Comments </span></b><b><span style="font-size:
15.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:
Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;mso-font-kerning:0pt">添加注释</span></b><b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">To add comments to your&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">.proto</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;files, use C/C++-style&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">//</span><span lang="EN-US" style="font-size:
12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">&nbsp;syntax.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">向</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt">.proto</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">文件添加注释，可以使用</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt">C/C++</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">风格的双斜杠（</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">//</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">）</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">语法格式。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<div style="mso-element:para-border-div;border:solid #BBBBBB 1.0pt;mso-border-alt:
solid #BBBBBB .75pt;padding:12.0pt 12.0pt 12.0pt 12.0pt;background:#FAFAFA"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">message SearchRequest {<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>required string query = 1;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>optional int32 page_number = 2;// Which page number do we want?<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>optional int32 result_per_page = 3;// Number of results to return per page.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">}<o:p></o:p></span></p>
</div>
<p align="left" class="MsoNormal" style="margin-top:18.0pt;text-align:left;
mso-pagination:widow-orphan;mso-outline-level:3"><br />
	<b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">What&#39;s Generated From Your</span></b><b><span lang="EN-US" style="font-size:15.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;</span></b><b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">.proto</span></b><b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">? </span></b><b><span style="font-size:15.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:#3333FF;mso-font-kerning:0pt">从你的</span></b><b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt">.proto</span></b><b><span style="font-size:
15.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:
Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;mso-font-kerning:0pt">文件生成了什么？</span></b><b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">When you run the&nbsp;<a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html#generating"><span style="color:#0000CC">protocol buffer compiler</span></a>&nbsp;on a&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">.proto</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">, the compiler generates the code in your chosen language you&#39;ll need to work with the message types you&#39;ve described in the file, including getting and setting field values, serializing your messages to an output stream, and parsing your messages from an input stream.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">当你对</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt">.proto</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">文件运行</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt">protocol buffer</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:#3333FF;mso-font-kerning:0pt">编译器（</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html#generating"><span style="color:#0000CC">protocol buffer compiler</span></a></span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:#3333FF;mso-font-kerning:0pt">）的时候，编译器生成你所选择的语言的代码，这些代码可以操作你在</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt">.proto</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:#3333FF;mso-font-kerning:0pt">文件中定义的消息类型，包括获取、设置字段值，将你的消息序列化到一个输出流中，以及从一个输入流中解析你的消息。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><o:p>&nbsp;</o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">For&nbsp;<b>C++</b>, the compiler generates a&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">.h</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;and&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">.cc</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;file from each&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">.proto</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">, with a class for each message type described in your file.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">For&nbsp;<b>Java</b>, the compiler generates a&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">.java</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;file with a class for each message type, as well as a special&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">Builder</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;classes for creating message class instances.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">对</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt">C++</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">来说，编译器为每一个</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt">.proto</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">文件生成了一个</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt">.h</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">文件和一个</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt">.cc</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">文件，</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt">.proto</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">文件中的每一个消息有一个对应的类。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">对</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt">Java</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">来说，编译器为每一个消息类型生成了一个</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt">.java</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:#3333FF;mso-font-kerning:0pt">文件，以及一个特殊的</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">Builder</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">类（这个类是用来创建消息类接口的）。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><o:p>&nbsp;</o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">Python</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;is a little different &ndash; the Python compiler generates a module with a static descriptor of each message type in your&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">.proto</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">, which is then used with a&nbsp;<i>metaclass</i>&nbsp;to create the necessary Python data access class at runtime.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">You can find out more about using the APIs for each language by following the tutorial for your chosen language. For even more API details, see the relevant&nbsp;<a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/reference/overview.html"><span style="color:#0000CC">API reference</span></a>.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">对</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt">Python</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">来说，有点不一样&mdash;&mdash;</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt">Python</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">编译器为</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt">.proto</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">文件中的每个消息类型生成一个模型，其含有一个静态描述符（</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">static descriptor</span><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:black;
mso-font-kerning:0pt">，</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">译者注：没用过</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt">Python</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">，不清楚这样翻译正确与否），该模型与一个元类（</span></b><i><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">metaclass</span></i><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">）在运行时（</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt">runtime</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">）被用来创建必需的</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt">Python</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">数据访问类。</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">你可以从每种语言的教程中找到更多使用使用</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt">API</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">的方法。如欲查看更详细的</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt">API</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">信息，请阅相关的文章</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/reference/overview.html"><span style="color:#0000CC">API reference</span></a></span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">。</span></b><span style="font-family: Helvetica, sans-serif; font-size: 12pt; line-height: 15pt; ">&nbsp;</span></p>
<div style="mso-element:para-border-div;border:none;border-top:solid #3366CC 1.0pt;
mso-border-top-alt:solid #3366CC .75pt;padding:1.0pt 0cm 0cm 0cm;background:
#E5ECF9;margin-left:-7.5pt;margin-right:0cm"></p>
<p align="left" class="MsoNormal" style="margin-top:24.0pt;text-align:left;
mso-pagination:widow-orphan;mso-outline-level:2;background:#E5ECF9;border:none;
mso-border-top-alt:solid #3366CC .75pt;padding:0cm;mso-padding-alt:1.0pt 0cm 0cm 0cm"><br />
		<b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">Scalar Value Types </span></b><b><span style="font-size:15.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">标量数值类型</span></b><b><span lang="EN-US" style="font-size:
15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
</div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">A scalar message field can have one of the following types &ndash; the table shows the type specified in the&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">.proto</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;file, and the corresponding type in the automatically generated class:<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">一个标量消息字段可以含有一个如下的类型&mdash;&mdash;该表格展示了定义于</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt">.proto</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:#3333FF;mso-font-kerning:0pt">文件中的类型，以及与之对应的、在自动生成的访问类中定义的类型：</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="width:97.02%;margin-left:9.0pt;border-collapse:collapse;border:none;
 mso-border-alt:solid #BBBBBB .75pt;mso-yfti-tbllook:1184" width="97%"></p>
<tbody>
<tr style="mso-yfti-irow:0;mso-yfti-firstrow:yes">
<td style="width:8.48%;border:solid #BBBBBB 1.0pt;
  mso-border-alt:solid #BBBBBB .75pt;background:#E5ECF9;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="8%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<b><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">.proto Type<o:p></o:p></span></b></p>
</td>
<td style="width:70.08%;border:solid #BBBBBB 1.0pt;
  border-left:none;mso-border-left-alt:solid #BBBBBB .75pt;mso-border-alt:solid #BBBBBB .75pt;
  background:#E5ECF9;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="70%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<b><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">Notes<o:p></o:p></span></b></p>
</td>
<td style="width:10.2%;border:solid #BBBBBB 1.0pt;
  border-left:none;mso-border-left-alt:solid #BBBBBB .75pt;mso-border-alt:solid #BBBBBB .75pt;
  background:#E5ECF9;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="10%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<b><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">C++ Type<o:p></o:p></span></b></p>
</td>
<td style="width:11.22%;border:solid #BBBBBB 1.0pt;
  border-left:none;mso-border-left-alt:solid #BBBBBB .75pt;mso-border-alt:solid #BBBBBB .75pt;
  background:#E5ECF9;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="11%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<b><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">Java Type<o:p></o:p></span></b></p>
</td>
</tr>
<tr style="mso-yfti-irow:1">
<td style="width:8.48%;border:solid #BBBBBB 1.0pt;
  border-top:none;mso-border-top-alt:solid #BBBBBB .75pt;mso-border-alt:solid #BBBBBB .75pt;
  background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="8%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">double<o:p></o:p></span></p>
</td>
<td style="width:70.08%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="70%"><br />
				&nbsp;</td>
<td style="width:10.2%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="10%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">double<o:p></o:p></span></p>
</td>
<td style="width:11.22%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="11%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">double<o:p></o:p></span></p>
</td>
</tr>
<tr style="mso-yfti-irow:2">
<td style="width:8.48%;border:solid #BBBBBB 1.0pt;
  border-top:none;mso-border-top-alt:solid #BBBBBB .75pt;mso-border-alt:solid #BBBBBB .75pt;
  background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="8%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">float<o:p></o:p></span></p>
</td>
<td style="width:70.08%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="70%"><br />
				&nbsp;</td>
<td style="width:10.2%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="10%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">float<o:p></o:p></span></p>
</td>
<td style="width:11.22%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="11%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">float<o:p></o:p></span></p>
</td>
</tr>
<tr style="mso-yfti-irow:3">
<td style="width:8.48%;border:solid #BBBBBB 1.0pt;
  border-top:none;mso-border-top-alt:solid #BBBBBB .75pt;mso-border-alt:solid #BBBBBB .75pt;
  background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="8%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">int32<o:p></o:p></span></p>
</td>
<td style="width:70.08%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="70%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">Uses variable-length encoding. Inefficient for encoding negative numbers &ndash; if your field is likely to have negative values, use sint32 instead.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
  mso-pagination:widow-orphan"><br />
					<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
  mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
  mso-font-kerning:0pt">使用可变长编码方式。编码负数时不够高效&mdash;&mdash;如果你的字段可能含有负数，那么请使用</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
  font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt">sint32</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
  宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;
  mso-bidi-font-family:Helvetica;color:#3333FF;mso-font-kerning:0pt">。</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;
  mso-font-kerning:0pt"><o:p></o:p></span></p>
</td>
<td style="width:10.2%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="10%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">int32<o:p></o:p></span></p>
</td>
<td style="width:11.22%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="11%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">int<o:p></o:p></span></p>
</td>
</tr>
<tr style="mso-yfti-irow:4">
<td style="width:8.48%;border:solid #BBBBBB 1.0pt;
  border-top:none;mso-border-top-alt:solid #BBBBBB .75pt;mso-border-alt:solid #BBBBBB .75pt;
  background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="8%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">int64<o:p></o:p></span></p>
</td>
<td style="width:70.08%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="70%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">Uses variable-length encoding. Inefficient for encoding negative numbers &ndash; if your field is likely to have negative values, use sint64 instead.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<b style="mso-bidi-font-weight:
  normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
  Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
  color:#3333FF;mso-font-kerning:0pt">使用可变长编码方式。编码负数时不够高效&mdash;&mdash;如果你的字段可能含有负数，那么请使用</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
  font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt">sint64</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
  宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;
  mso-bidi-font-family:Helvetica;color:#3333FF;mso-font-kerning:0pt">。</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;
  mso-font-kerning:0pt"><o:p></o:p></span></p>
</td>
<td style="width:10.2%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="10%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">int64<o:p></o:p></span></p>
</td>
<td style="width:11.22%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="11%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">long<o:p></o:p></span></p>
</td>
</tr>
<tr style="mso-yfti-irow:5">
<td style="width:8.48%;border:solid #BBBBBB 1.0pt;
  border-top:none;mso-border-top-alt:solid #BBBBBB .75pt;mso-border-alt:solid #BBBBBB .75pt;
  background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="8%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">uint32<o:p></o:p></span></p>
</td>
<td style="width:70.08%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="70%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">Uses variable-length encoding.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<b style="mso-bidi-font-weight:
  normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
  Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
  color:#3333FF;mso-font-kerning:0pt">使用可变长编码方式。</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt"><o:p></o:p></span></p>
</td>
<td style="width:10.2%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="10%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">uint32<o:p></o:p></span></p>
</td>
<td style="width:11.22%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="11%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">int<sup>[1]</sup><o:p></o:p></span></p>
</td>
</tr>
<tr style="mso-yfti-irow:6">
<td style="width:8.48%;border:solid #BBBBBB 1.0pt;
  border-top:none;mso-border-top-alt:solid #BBBBBB .75pt;mso-border-alt:solid #BBBBBB .75pt;
  background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="8%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">uint64<o:p></o:p></span></p>
</td>
<td style="width:70.08%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="70%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">Uses variable-length encoding.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<b style="mso-bidi-font-weight:
  normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
  Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
  color:#3333FF;mso-font-kerning:0pt">使用可变长编码方式。</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt"><o:p></o:p></span></p>
</td>
<td style="width:10.2%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="10%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">uint64<o:p></o:p></span></p>
</td>
<td style="width:11.22%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="11%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">long<sup>[1]</sup><o:p></o:p></span></p>
</td>
</tr>
<tr style="mso-yfti-irow:7">
<td style="width:8.48%;border:solid #BBBBBB 1.0pt;
  border-top:none;mso-border-top-alt:solid #BBBBBB .75pt;mso-border-alt:solid #BBBBBB .75pt;
  background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="8%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">sint32<o:p></o:p></span></p>
</td>
<td style="width:70.08%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="70%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<b style="mso-bidi-font-weight:
  normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
  Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
  color:#3333FF;mso-font-kerning:0pt">使用可变长编码方式。有符号的整型值。编码时比通常的</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
  font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt">int32</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
  宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;
  mso-bidi-font-family:Helvetica;color:#3333FF;mso-font-kerning:0pt">高效。</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;
  mso-font-kerning:0pt"><o:p></o:p></span></p>
</td>
<td style="width:10.2%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="10%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">int32<o:p></o:p></span></p>
</td>
<td style="width:11.22%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="11%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">int<o:p></o:p></span></p>
</td>
</tr>
<tr style="mso-yfti-irow:8">
<td style="width:8.48%;border:solid #BBBBBB 1.0pt;
  border-top:none;mso-border-top-alt:solid #BBBBBB .75pt;mso-border-alt:solid #BBBBBB .75pt;
  background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="8%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">sint64<o:p></o:p></span></p>
</td>
<td style="width:70.08%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="70%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<b style="mso-bidi-font-weight:
  normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
  Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
  color:#3333FF;mso-font-kerning:0pt">使用可变长编码方式。有符号的整型值。编码时比通常的</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
  font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt">int64</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
  宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;
  mso-bidi-font-family:Helvetica;color:#3333FF;mso-font-kerning:0pt">高效。</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;
  mso-font-kerning:0pt"><o:p></o:p></span></p>
</td>
<td style="width:10.2%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="10%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">int64<o:p></o:p></span></p>
</td>
<td style="width:11.22%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="11%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">long<o:p></o:p></span></p>
</td>
</tr>
<tr style="mso-yfti-irow:9">
<td style="width:8.48%;border:solid #BBBBBB 1.0pt;
  border-top:none;mso-border-top-alt:solid #BBBBBB .75pt;mso-border-alt:solid #BBBBBB .75pt;
  background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="8%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">fixed32<o:p></o:p></span></p>
</td>
<td style="width:70.08%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="70%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">Always four bytes. More efficient than uint32 if values are often greater than 2<sup>28</sup>.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<b style="mso-bidi-font-weight:
  normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
  Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
  color:#3333FF;mso-font-kerning:0pt">总是</span></b><b style="mso-bidi-font-weight:
  normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
  color:#3333FF;mso-font-kerning:0pt">4</span></b><b style="mso-bidi-font-weight:
  normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
  Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
  color:#3333FF;mso-font-kerning:0pt">个字节。如果数值总是比总是比</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;
  mso-font-kerning:0pt">2<sup>28</sup></span><b style="mso-bidi-font-weight:
  normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
  Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
  color:#3333FF;mso-font-kerning:0pt">大的话，这个类型会比</span></b><b style="mso-bidi-font-weight:
  normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
  color:#3333FF;mso-font-kerning:0pt">uint32</span></b><b style="mso-bidi-font-weight:
  normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
  Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
  color:#3333FF;mso-font-kerning:0pt">高效。</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt"><o:p></o:p></span></p>
</td>
<td style="width:10.2%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="10%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">uint32<o:p></o:p></span></p>
</td>
<td style="width:11.22%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="11%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">int<sup>[1]</sup><o:p></o:p></span></p>
</td>
</tr>
<tr style="mso-yfti-irow:10">
<td style="width:8.48%;border:solid #BBBBBB 1.0pt;
  border-top:none;mso-border-top-alt:solid #BBBBBB .75pt;mso-border-alt:solid #BBBBBB .75pt;
  background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="8%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">fixed64<o:p></o:p></span></p>
</td>
<td style="width:70.08%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="70%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">Always eight bytes. More efficient than uint64 if values are often greater than 2<sup>56</sup>.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<b style="mso-bidi-font-weight:
  normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
  Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
  color:#3333FF;mso-font-kerning:0pt">总是</span></b><b style="mso-bidi-font-weight:
  normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
  color:#3333FF;mso-font-kerning:0pt">8</span></b><b style="mso-bidi-font-weight:
  normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
  Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
  color:#3333FF;mso-font-kerning:0pt">个字节。如果数值总是比总是比</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;
  mso-font-kerning:0pt">2<sup>56</sup></span><b style="mso-bidi-font-weight:
  normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
  Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
  color:#3333FF;mso-font-kerning:0pt">大的话，这个类型会比</span></b><b style="mso-bidi-font-weight:
  normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
  color:#3333FF;mso-font-kerning:0pt">uint64</span></b><b style="mso-bidi-font-weight:
  normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
  Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
  color:#3333FF;mso-font-kerning:0pt">高效。</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt"><o:p></o:p></span></p>
</td>
<td style="width:10.2%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="10%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">uint64<o:p></o:p></span></p>
</td>
<td style="width:11.22%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="11%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">long<sup>[1]</sup><o:p></o:p></span></p>
</td>
</tr>
<tr style="mso-yfti-irow:11">
<td style="width:8.48%;border:solid #BBBBBB 1.0pt;
  border-top:none;mso-border-top-alt:solid #BBBBBB .75pt;mso-border-alt:solid #BBBBBB .75pt;
  background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="8%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">sfixed32<o:p></o:p></span></p>
</td>
<td style="width:70.08%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="70%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">Always four bytes.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<b style="mso-bidi-font-weight:
  normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
  Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
  color:#3333FF;mso-font-kerning:0pt">总是</span></b><b style="mso-bidi-font-weight:
  normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
  color:#3333FF;mso-font-kerning:0pt">4</span></b><b style="mso-bidi-font-weight:
  normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
  Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
  color:#3333FF;mso-font-kerning:0pt">个字节。</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt"><o:p></o:p></span></p>
</td>
<td style="width:10.2%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="10%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">int32<o:p></o:p></span></p>
</td>
<td style="width:11.22%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="11%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">int<o:p></o:p></span></p>
</td>
</tr>
<tr style="mso-yfti-irow:12">
<td style="width:8.48%;border:solid #BBBBBB 1.0pt;
  border-top:none;mso-border-top-alt:solid #BBBBBB .75pt;mso-border-alt:solid #BBBBBB .75pt;
  background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="8%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">sfixed64<o:p></o:p></span></p>
</td>
<td style="width:70.08%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="70%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">Always eight bytes.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<b style="mso-bidi-font-weight:
  normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
  Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
  color:#3333FF;mso-font-kerning:0pt">总是</span></b><b style="mso-bidi-font-weight:
  normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
  color:#3333FF;mso-font-kerning:0pt">8</span></b><b style="mso-bidi-font-weight:
  normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
  Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
  color:#3333FF;mso-font-kerning:0pt">个字节。</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt"><o:p></o:p></span></p>
</td>
<td style="width:10.2%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="10%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">int64<o:p></o:p></span></p>
</td>
<td style="width:11.22%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="11%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">long<o:p></o:p></span></p>
</td>
</tr>
<tr style="mso-yfti-irow:13">
<td style="width:8.48%;border:solid #BBBBBB 1.0pt;
  border-top:none;mso-border-top-alt:solid #BBBBBB .75pt;mso-border-alt:solid #BBBBBB .75pt;
  background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="8%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">bool<o:p></o:p></span></p>
</td>
<td style="width:70.08%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="70%"><br />
				&nbsp;</td>
<td style="width:10.2%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="10%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">bool<o:p></o:p></span></p>
</td>
<td style="width:11.22%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="11%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">boolean<o:p></o:p></span></p>
</td>
</tr>
<tr style="mso-yfti-irow:14">
<td style="width:8.48%;border:solid #BBBBBB 1.0pt;
  border-top:none;mso-border-top-alt:solid #BBBBBB .75pt;mso-border-alt:solid #BBBBBB .75pt;
  background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="8%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">string<o:p></o:p></span></p>
</td>
<td style="width:70.08%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="70%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">A string must always contain UTF-8 encoded or 7-bit ASCII text.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<b style="mso-bidi-font-weight:
  normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
  Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
  color:#3333FF;mso-font-kerning:0pt">一个字符串必须是</span></b><b style="mso-bidi-font-weight:
  normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
  color:#3333FF;mso-font-kerning:0pt">UTF-8</span></b><b style="mso-bidi-font-weight:
  normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
  Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
  color:#3333FF;mso-font-kerning:0pt">编码或者</span></b><b style="mso-bidi-font-weight:
  normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
  color:#3333FF;mso-font-kerning:0pt">7-bit ASCII</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
  宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;
  mso-bidi-font-family:Helvetica;color:#3333FF;mso-font-kerning:0pt">编码的文本。</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;
  mso-font-kerning:0pt"><o:p></o:p></span></p>
</td>
<td style="width:10.2%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="10%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">string<o:p></o:p></span></p>
</td>
<td style="width:11.22%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="11%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">String<o:p></o:p></span></p>
</td>
</tr>
<tr style="mso-yfti-irow:15;mso-yfti-lastrow:yes">
<td style="width:8.48%;border:solid #BBBBBB 1.0pt;
  border-top:none;mso-border-top-alt:solid #BBBBBB .75pt;mso-border-alt:solid #BBBBBB .75pt;
  background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="8%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">bytes<o:p></o:p></span></p>
</td>
<td style="width:70.08%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="70%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">May contain any arbitrary sequence of bytes.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<b style="mso-bidi-font-weight:
  normal"><span style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:
  宋体;color:#3333FF;mso-font-kerning:0pt">可能包含任意顺序的字节数据。<span lang="EN-US"><o:p></o:p></span></span></b></p>
</td>
<td style="width:10.2%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="10%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">string<o:p></o:p></span></p>
</td>
<td style="width:11.22%;border-top:none;border-left:
  none;border-bottom:solid #BBBBBB 1.0pt;border-right:solid #BBBBBB 1.0pt;
  mso-border-top-alt:solid #BBBBBB .75pt;mso-border-left-alt:solid #BBBBBB .75pt;
  mso-border-alt:solid #BBBBBB .75pt;background:white;padding:4.5pt 9.0pt 4.5pt 9.0pt" valign="top" width="11%"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
  line-height:15.0pt;mso-pagination:widow-orphan"><br />
					<span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:宋体;mso-font-kerning:
  0pt">ByteString<o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">You can find out more about how these types are encoded when you serialize your message in&nbsp;<a href="http://code.google.com/apis/protocolbuffers/docs/encoding.html"><span style="color:#0000CC">Protocol Buffer Encoding</span></a>.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<sup><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">[1]</span></sup><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;In Java, unsigned 32-bit and 64-bit integers are represented using their signed counterparts, with the top bit simply being stored in the sign bit.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">你可以在文章</span></b><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><a href="http://code.google.com/apis/protocolbuffers/docs/encoding.html"><span style="color:#0000CC">Protocol Buffer Encoding</span></a></span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:#3333FF;mso-font-kerning:0pt">中，找到更多&ldquo;序列化消息时各种类型如何编码&rdquo;的信息。</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt"><o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<sup><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">[1]</span></sup><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:#3333FF;mso-font-kerning:0pt">在</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt">Java</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">中，无符号</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt">32</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">位和</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt">64</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">位整型以它们对应的有符号类型来表示。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<div style="mso-element:para-border-div;border:none;border-top:solid #3366CC 1.0pt;
mso-border-top-alt:solid #3366CC .75pt;padding:1.0pt 0cm 0cm 0cm;background:
#E5ECF9;margin-left:-7.5pt;margin-right:0cm"></p>
<p align="left" class="MsoNormal" style="margin-top:24.0pt;text-align:left;
mso-pagination:widow-orphan;mso-outline-level:2;background:#E5ECF9;border:none;
mso-border-top-alt:solid #3366CC .75pt;padding:0cm;mso-padding-alt:1.0pt 0cm 0cm 0cm"><br />
		<b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">Optional Fields And Default Values </span></b><b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt">Optional</span></b><b><span style="font-size:15.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">的字段和默认值</span></b><b><span lang="EN-US" style="font-size:
15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
</div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">As mentioned above, elements in a message description can be labeled&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">optional</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">. A well-formed message may or may not contain an optional element. When a message is parsed, if it does not contain an optional element, the corresponding field in the parsed object is set to the default value for that field. The default value can be specified as part of the message description. For example, let&#39;s say you want to provide a default value of 10 for a&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">SearchRequest</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&#39;s&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">result_per_page</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;value.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">如上所述，消息描述中的一个元素可以被标记为&ldquo;可选的&rdquo;（</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt">optional</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:#3333FF;mso-font-kerning:0pt">）。一个格式良好的消息可以包含一个</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt">optional</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:#3333FF;mso-font-kerning:0pt">的元素，也可以不包含。当解析一个消息的时候，如果它不包含</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt">optional</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:#3333FF;mso-font-kerning:0pt">的元素，那么解析出来的对象中的对应字段就被置为默认值。默认值可以在消息描述文件中指定。例如，要为</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">SearchRequest</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">消息的</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">result_per_page</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">字段指定默认值</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt">10</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">，可以这样做：</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<div style="mso-element:para-border-div;border:solid #BBBBBB 1.0pt;mso-border-alt:
solid #BBBBBB .75pt;padding:12.0pt 12.0pt 12.0pt 12.0pt;background:#FAFAFA"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">optional int32 result_per_page = 3 [default = 10];<o:p></o:p></span></p>
</div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">If the default value is not specified for an optional element, a type-specific default value is used instead: for strings, the default value is the empty string. For bools, the default value is false. For numeric types, the default value is zero. For enums, the default value is the first value listed in the enum&#39;s type definition.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">如果没有为</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt">optional</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">的元素指定默认值，</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">那么就会使用与特定类型相关的默认值：对</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">string</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">来说，默认值是空字符串。对</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">bool</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">来说，默认值是</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">false</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">。对数值类型来说，默认值是</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">0</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">。对枚举来说，默认值是枚举类型定义中的第一个值。</span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span style="color: rgb(255, 255, 255); font-family: arial, helvetica, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a></p>
<div style="mso-element:para-border-div;border:none;border-top:solid #3366CC 1.0pt;
mso-border-top-alt:solid #3366CC .75pt;padding:1.0pt 0cm 0cm 0cm;background:
#E5ECF9;margin-left:-7.5pt;margin-right:0cm"></p>
<p align="left" class="MsoNormal" style="margin-top:24.0pt;text-align:left;
mso-pagination:widow-orphan;mso-outline-level:2;background:#E5ECF9;border:none;
mso-border-top-alt:solid #3366CC .75pt;padding:0cm;mso-padding-alt:1.0pt 0cm 0cm 0cm"><br />
		<b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">Enumerations </span></b><b><span style="font-size:15.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">枚举</span></b><b><span lang="EN-US" style="font-size:15.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
</div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">When you&#39;re defining a message type, you might want one of its fields to only have one of a pre-defined list of values. For example, let&#39;s say you want to add a&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">corpus</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;field for each&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">SearchRequest</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">, where the corpus can be&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">UNIVERSAL</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">,&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">WEB</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">,&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">IMAGES</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">,&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">LOCAL</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">,&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">NEWS</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">,&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">PRODUCTS</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;or&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">VIDEO</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">. You can do this very simply by adding an&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">enum</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;to your message definition - a field with an&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">enum</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;type can only have one of a specified set of constants as its value (if you try to provide a different value, the parser will treat it like an unknown field). In the following example we&#39;ve added an&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">enum</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;called&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">Corpus</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">with all the possible values, and a field of type&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">Corpus</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">:<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">当你定义一个消息类型的时候，你可能想为一个字段指定某&ldquo;预定义值序列&rdquo;（</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">pre-defined list of values</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:#3333FF;mso-font-kerning:0pt">）中的一个值。例如，假设你想为每一个</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">SearchRequest</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">消息添加一个</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">corpus</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">字段，而</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">corpus</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">的值可能是</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">UNIVERSAL</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">，</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">WEB</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">，</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">IMAGES</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">，</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">LOCAL</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">，</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">NEWS</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">，</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">PRODUCTS</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">或</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">VIDEO</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">中的一个。你可以很容易地实现这一点：通过向你的消息定义中添加一个枚举（</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">enum</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">）就可以了。一个</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">enum</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">类型的字段只能用指定的常量集（</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">specified set of constants</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">）中的一个值作为其值（如果你尝试指定不同的值，解析器就会把它当作一个未知的字段来对待）。在下面的例子中，我们已经添加了一个叫做</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">Corpus</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">的枚举（</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">enum</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">）&mdash;&mdash;它含有所有可能的值&mdash;&mdash;以及一个类型为</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">Corpus</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">的字段：</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt"><o:p></o:p></span></p>
<div style="mso-element:para-border-div;border:solid #BBBBBB 1.0pt;mso-border-alt:
solid #BBBBBB .75pt;padding:12.0pt 12.0pt 12.0pt 12.0pt;background:#FAFAFA"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">message SearchRequest {<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>required string query = 1;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>optional int32 page_number = 2;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>optional int32 result_per_page = 3 [default = 10];<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>enum Corpus {<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp; </span>UNIVERSAL = 0;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp; </span>WEB = 1;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp; </span>IMAGES = 2;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp; </span>LOCAL = 3;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp; </span>NEWS = 4;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp; </span>PRODUCTS = 5;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp; </span>VIDEO = 6;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>}<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>optional Corpus corpus = 4 [default = UNIVERSAL];<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">}<o:p></o:p></span></p>
</div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">Enumerator constants must be in the range of a 32-bit integer. Since&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">enum</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;values use varint encoding on the wire, negative values are inefficient and thus not recommended. You can define&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">enum</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">s within a message definition, as in the above example, or outside &ndash; these&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">enum</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">s can be reused in any message definition in your&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">.proto</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;file. You can also use an&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">enum</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;type declared in one message as the type of a field in a different message, using the syntax&nbsp;</span><i><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">MessageType</span></i><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">.<i>EnumType</i></span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">When you run the protocol buffer compiler on a&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">.proto</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;that uses an&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">enum</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">, the generated code will have a corresponding&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">enum</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;for Java or C++, or a special&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">EnumDescriptor</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;class for Python that&#39;s used to create a set of symbolic constants with integer values in the runtime-generated class.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">For more information about how to work with message&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">enum</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">s in your applications, see the&nbsp;<a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/reference/overview.html"><span style="color:#0000CC">generated code guide</span></a>&nbsp;for your chosen language.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">枚举常量必须在</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt">32</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">位整型值的范围内。因为</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">enum</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">值是使用可变编码方式的，对负数不够高效，因此不推荐在</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt">enum</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:#3333FF;mso-font-kerning:0pt">中使用负数。如上例所示，你可以在一个消息定义的内部或外部定义枚举&mdash;&mdash;这些枚举可以在你的</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt">.proto</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:#3333FF;mso-font-kerning:0pt">文件中的任何消息定义里重用。你也可以在一个消息中声明一个枚举类型，而在另一个不同的消息中使用它&mdash;&mdash;采用</span></b><i><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">MessageType</span></i><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">.<i>EnumType</i></span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">的语法格式。</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">当你对一个使用了枚举的</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt">.proto</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">文件运行</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt">protocol buffer</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:#3333FF;mso-font-kerning:0pt">编译器的时候，生成的代码中将有一个对应的</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">enum</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">（对</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt">Java</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">或</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt">C++</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">来说），或者一个特殊的</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">EnumDescriptor</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">类（对</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">Python</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">来说），它被用来在运行时生成的类中创建一系列的整型值符号常量（</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">symbolic constants</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">）。</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">关于如何在你的应用程序的消息中使用枚举的更多信息，请查看你所选择的语言的</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/reference/overview.html"><span style="color:#0000CC">generated code guide</span></a></span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:#3333FF;mso-font-kerning:0pt">。</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<div style="mso-element:para-border-div;border:none;border-top:solid #3366CC 1.0pt;
mso-border-top-alt:solid #3366CC .75pt;padding:1.0pt 0cm 0cm 0cm;background:
#E5ECF9;margin-left:-7.5pt;margin-right:0cm"></p>
<p align="left" class="MsoNormal" style="margin-top:24.0pt;text-align:left;
mso-pagination:widow-orphan;mso-outline-level:2;background:#E5ECF9;border:none;
mso-border-top-alt:solid #3366CC .75pt;padding:0cm;mso-padding-alt:1.0pt 0cm 0cm 0cm"><br />
		<b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">Using Other Message Types </span></b><b><span style="font-size:15.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">使用其他消息类型</span></b><b><span lang="EN-US" style="font-size:
15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
</div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">You can use other message types as field types. For example, let&#39;s say you wanted to include&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">Result</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;messages in each&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">SearchResponse</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">message &ndash; to do this, you can define a&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">Result</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;message type in the same&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">.proto</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;and then specify a field of type&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">Result</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;in&nbsp;</span><span lang="EN-US" style="font-size:
10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;
mso-font-kerning:0pt">SearchResponse</span><span lang="EN-US" style="font-size:
12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">:<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">你可以将其他消息类型用作字段类型。例如，假设你想在每一个</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">SearchResponse</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">消息中包含</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">Result</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">消息，你可以这样做&mdash;&mdash;在相同的</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt">.proto</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:#3333FF;mso-font-kerning:0pt">文件中定义一个</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">Result</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">消息类型，然后在</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">SearchResponse</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">消息中指定一个</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">Result</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">类型的字段：</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt"><o:p></o:p></span></p>
<div style="mso-element:para-border-div;border:solid #BBBBBB 1.0pt;mso-border-alt:
solid #BBBBBB .75pt;padding:12.0pt 12.0pt 12.0pt 12.0pt;background:#FAFAFA"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">message SearchResponse {<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>repeated Result result = 1;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">}<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><o:p>&nbsp;</o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">message Result {<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>required string url = 1;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>optional string title = 2;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>repeated string snippets = 3;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">}<o:p></o:p></span></p>
</div>
<p align="left" class="MsoNormal" style="margin-top:18.0pt;text-align:left;
mso-pagination:widow-orphan;mso-outline-level:3"><br />
	<b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">Importing Definitions </span></b><b><span style="font-size:15.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">导入定义</span></b><b><span lang="EN-US" style="font-size:15.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">In the above example, the&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">Result</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;message type is defined in the same file as&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">SearchResponse</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;&ndash; what if the message type you want to use as a field type is already defined in another&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">.proto</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;file?<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">在上面的例子中，</span></b><span lang="EN-US" style="font-size:
10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;
mso-font-kerning:0pt">Result</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">消息类型与</span></b><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">SearchResponse</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">是定义在同一文件中的&mdash;&mdash;如果你要使用的消息类型已经在其他</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt">.proto</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:#3333FF;mso-font-kerning:0pt">文件中已经定义过了呢？</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt"><o:p>&nbsp;</o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">You can use definitions from other&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">.proto</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;files by&nbsp;<i>importing</i>&nbsp;them. To import another&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">.proto</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&#39;s definitions, you add an import statement to the top of your file:<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">你可以通过导入（</span></b><i><span lang="EN-US" style="font-size:
12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">importing</span></i><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:#3333FF;mso-font-kerning:0pt">）其他</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt">.proto</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:#3333FF;mso-font-kerning:0pt">文件中的定义来使用它们。要导入其他</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt">.proto</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:#3333FF;mso-font-kerning:0pt">文件的定义，你需要在你的文件中添加一个导入声明：</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<div style="mso-element:para-border-div;border:solid #BBBBBB 1.0pt;mso-border-alt:
solid #BBBBBB .75pt;padding:12.0pt 12.0pt 12.0pt 12.0pt;background:#FAFAFA"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">import &quot;myproject/other_protos.proto&quot;;<o:p></o:p></span></p>
</div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">The protocol compiler searches for imported files in a set of directories specified on the protocol compiler command line using the&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">-I</span><span lang="EN-US" style="font-size:
12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">/</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">--import_path</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;flag. If no flag was given, it looks in the directory in which the compiler was invoked.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">然后，</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt">protocol</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">编译器就会在一系列目录中查找需要被导入的文件，这些目录通过</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt">protocol</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:#3333FF;mso-font-kerning:0pt">编译器的命令行参数</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">-I</span><span lang="EN-US" style="font-size:
12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">/</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">--import_path</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">指定。如果不提供参数，编译器就在其调用目录下查找。</span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span style="color: rgb(255, 255, 255); font-family: arial, helvetica, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a></p>
<div style="mso-element:para-border-div;border:none;border-top:solid #3366CC 1.0pt;
mso-border-top-alt:solid #3366CC .75pt;padding:1.0pt 0cm 0cm 0cm;background:
#E5ECF9;margin-left:-7.5pt;margin-right:0cm"></p>
<p align="left" class="MsoNormal" style="margin-top:24.0pt;text-align:left;
mso-pagination:widow-orphan;mso-outline-level:2;background:#E5ECF9;border:none;
mso-border-top-alt:solid #3366CC .75pt;padding:0cm;mso-padding-alt:1.0pt 0cm 0cm 0cm"><br />
		<b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">Nested Types </span></b><b><span style="font-size:15.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">嵌套类型</span></b><b><span lang="EN-US" style="font-size:15.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
</div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">You can define and use message types inside other message types, as in the following example &ndash; here the&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">Result</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;message is defined inside the </span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">SearchResponse</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;message:<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">你可以在其他消息类型中定义、使用消息类型，在下面的例子中，</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">Result</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">消息就定义在</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">SearchResponse</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">消息内：</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt"><o:p></o:p></span></p>
<div style="mso-element:para-border-div;border:solid #BBBBBB 1.0pt;mso-border-alt:
solid #BBBBBB .75pt;padding:12.0pt 12.0pt 12.0pt 12.0pt;background:#FAFAFA"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">message SearchResponse {<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>message Result {<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp; </span>required string url = 1;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp; </span>optional string title = 2;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp; </span>repeated string snippets = 3;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>}<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>repeated Result result = 1;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">}<o:p></o:p></span></p>
</div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">If you want to reuse this message type outside its parent message type, you refer to it as&nbsp;</span><i><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">Parent</span></i><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">.<i>Type</i></span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">:<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">如果你想在它的父消息类型的外部重用这个消息类型，你需要以</span></b><i><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">Parent</span></i><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">.<i>Type</i></span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">的形式使用它：</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<div style="mso-element:para-border-div;border:solid #BBBBBB 1.0pt;mso-border-alt:
solid #BBBBBB .75pt;padding:12.0pt 12.0pt 12.0pt 12.0pt;background:#FAFAFA"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">message SomeOtherMessage {<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>optional SearchResponse.Result result = 1;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">}<o:p></o:p></span></p>
</div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">You can nest messages as deeply as you like:<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">你可以将消息嵌套任意多层：</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<div style="mso-element:para-border-div;border:solid #BBBBBB 1.0pt;mso-border-alt:
solid #BBBBBB .75pt;padding:12.0pt 12.0pt 12.0pt 12.0pt;background:#FAFAFA"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">message Outer {<span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>// Level 0<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>message MiddleAA {<span style="mso-spacerun:yes">&nbsp; </span>// Level 1<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp; </span>message Inner {<span style="mso-spacerun:yes">&nbsp;&nbsp; </span>// Level 2<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>required int64 ival = 1;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>optional bool<span style="mso-spacerun:yes">&nbsp; </span>booly = 2;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp; </span>}<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>}<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>message MiddleBB {<span style="mso-spacerun:yes">&nbsp; </span>// Level 1<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp; </span>message Inner {<span style="mso-spacerun:yes">&nbsp;&nbsp; </span>// Level 2<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>required int32 ival = 1;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>optional bool<span style="mso-spacerun:yes">&nbsp; </span>booly = 2;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp; </span>}<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>}<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">}<o:p></o:p></span></p>
</div>
<p align="left" class="MsoNormal" style="margin-top:18.0pt;text-align:left;
mso-pagination:widow-orphan;mso-outline-level:3"><br />
	<b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">Groups </span></b><b><span style="font-size:15.0pt;
font-family:宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;
mso-bidi-font-family:Helvetica;color:#3333FF;mso-font-kerning:0pt">组</span></b><b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">Note that this feature is deprecated and should not be used when creating new message types &ndash; use nested message types instead.<o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:red;
mso-font-kerning:0pt">注意：这个特性已经被弃用了，在创建新的消息类型的时候，不应该再使用它&mdash;&mdash;你应该使用嵌套消息类型来代替它。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:red;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">Groups are another way to nest information in your message definitions. For example, another way to specify a&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">SearchResponse</span><span lang="EN-US" style="font-size:12.0pt;font-family:
&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">&nbsp;containing a number of&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">Result</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">s is as follows:<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">&ldquo;组&rdquo;是在你的消息定义中嵌套信息的另一种方法。例如，在</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">SearchResponse</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">中包含若干</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">Result</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">的另一种方法是</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt"> </span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">：</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<div style="mso-element:para-border-div;border:solid #BBBBBB 1.0pt;mso-border-alt:
solid #BBBBBB .75pt;padding:12.0pt 12.0pt 12.0pt 12.0pt;background:#FAFAFA"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">message SearchResponse {<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>repeated group Result = 1 {<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp; </span>required string url = 2;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp; </span>optional string title = 3;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp; </span>repeated string snippets = 4;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>}<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">}<o:p></o:p></span></p>
</div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">A group simply combines a nested message type and a field into a single declaration. In your code, you can treat this message just as if it had a</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">Result</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;type field called&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">result</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;(the latter name is converted to lower-case so that it does not conflict with the former). Therefore, this example is exactly equivalent to the&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">SearchResponse</span><span lang="EN-US" style="font-size:12.0pt;font-family:
&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">&nbsp;above, except that the message has a different&nbsp;<a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/encoding.html"><span style="color:#0000CC">wire format</span></a>.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">一个&ldquo;组&rdquo;只是简单地将一个嵌套消息类型和一个字段捆绑到一个单独的声明中。在你的代码中，你可以把它看成是含有一个</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">Result</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">类型、名叫</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">result</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">的字段的消息（后面的名字被转换成了小写，所以它不会与前面的冲突）。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">因此，除了数据传输格式（</span></b><span lang="EN-US" style="font-size:
12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/encoding.html"><span style="color:#0000CC">wire format</span></a></span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">）不同之外，这个例子与上面的</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">SearchResponse</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">例子是完全等价的。</span></b><span style="font-family: Helvetica, sans-serif; font-size: 12pt; line-height: 15pt; ">&nbsp;</span></p>
<div style="mso-element:para-border-div;border:none;border-top:solid #3366CC 1.0pt;
mso-border-top-alt:solid #3366CC .75pt;padding:1.0pt 0cm 0cm 0cm;background:
#E5ECF9;margin-left:-7.5pt;margin-right:0cm"></p>
<p align="left" class="MsoNormal" style="margin-top:24.0pt;text-align:left;
mso-pagination:widow-orphan;mso-outline-level:2;background:#E5ECF9;border:none;
mso-border-top-alt:solid #3366CC .75pt;padding:0cm;mso-padding-alt:1.0pt 0cm 0cm 0cm"><br />
		<b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">Updating A Message Type </span></b><b><span style="font-size:15.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">更新一个消息类型</span></b><b><span lang="EN-US" style="font-size:
15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
</div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">If an existing message type no longer meets all your needs &ndash; for example, you&#39;d like the message format to have an extra field &ndash; but you&#39;d still like to use code created with the old format, don&#39;t worry! It&#39;s very simple to update message types without breaking any of your existing code. Just remember the following rules:<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">如果一个已有的消息无法再满足你的需求&mdash;&mdash;例如，你想在消息中添加一个额外的字段&mdash;&mdash;但是你同时还想让为旧版本写的代码仍然可用，不用怕！更新消息而不破坏已有代码是非常简单的。只要你记住下面的规则：</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l8 level1 lfo3;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">Don&#39;t change the numeric tags for any existing fields.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l8 level1 lfo3;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">Any new fields that you add should be&nbsp;</span><span lang="EN-US" style="font-size:
10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;
mso-font-kerning:0pt">optional</span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">&nbsp;or&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">repeated</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">. This means that any messages serialized by code using your &quot;old&quot; message format can be parsed by your new generated code, as they won&#39;t be missing any&nbsp;</span><span lang="EN-US" style="font-size:
10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;
mso-font-kerning:0pt">required</span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">&nbsp;elements. You should set up sensible&nbsp;<a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html#optional"><span style="color:#0000CC">default values</span></a>&nbsp;for these elements so that new code can properly interact with messages generated by old code. Similarly, messages created by your new code can be parsed by your old code: old binaries simply ignore the new field when parsing. However, the unknown fields are not discarded, and if the message is later serialized, the unknown fields are serialized along with it &ndash; so if the message is passed on to new code, the new fields are still available. Note that preservation of unknown fields is currently not available for Python.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l8 level1 lfo3;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">Non-required fields can be removed, as long as the tag number is not used again in your updated message type (it may be better to rename the field instead, perhaps adding the prefix &quot;OBSOLETE_&quot;, so that future users of your&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">.proto</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;can&#39;t accidentally reuse the number).<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l8 level1 lfo3;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">A non-required field can be converted to an&nbsp;<a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html#extensions"><span style="color:#0000CC">extension</span></a>&nbsp;and vice versa, as long as the type and number stay the same.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l8 level1 lfo3;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">int32</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">,&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">uint32</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">,&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">int64</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">,&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">uint64</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">, and&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">bool</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;are all compatible &ndash; this means you can change a field from one of these types to another without breaking forwards- or backwards-compatibility. If a number is parsed from the wire which doesn&#39;t fit in the corresponding type, you will get the same effect as if you had cast the number to that type in C++ (e.g. if a 64-bit number is read as an int32, it will be truncated to 32 bits).<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l8 level1 lfo3;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">sint32</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;and&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">sint64</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;are compatible with each other but are&nbsp;<i>not</i>&nbsp;compatible with the other integer types.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l8 level1 lfo3;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">string</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;and&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">bytes</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;are compatible as long as the bytes are valid UTF-8.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l8 level1 lfo3;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">Embedded messages are compatible with&nbsp;</span><span lang="EN-US" style="font-size:
10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;
mso-font-kerning:0pt">bytes</span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">&nbsp;if the bytes contain an encoded version of the message.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l8 level1 lfo3;tab-stops:list 36.0pt"><br />
	<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">fixed32</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;is compatible with&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">sfixed32</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">, and&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">fixed64</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;with&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">sfixed64</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:32.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-21.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l12 level1 lfo11"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings;color:#3333FF;mso-font-kerning:0pt"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp;</span></span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">不要更改任何已有的字段的数值标识（</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt">tag</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:#3333FF;mso-font-kerning:0pt">）。</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:32.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-21.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l12 level1 lfo11"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings;color:#3333FF;mso-font-kerning:0pt"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp;</span></span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">你添加的任何字段都必须是</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt">optional</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">或</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt">repeated</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">的。这就意味着任何使用你的&ldquo;旧&rdquo;消息格式的代码序列化的消息可以被你的新代码所解析，因为它们不会丢掉任何</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt">required</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:#3333FF;mso-font-kerning:0pt">的元素。你应该为这些元素设置合理的默认值（</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html#optional"><span style="color:#0000CC">default values</span></a></span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">），这样新的代码就能够正确地与老代码生成的消息交互了。类似地，你的新代码创建的消息也能被你的老代码解析：老的二进制程序在解析的时候只是简单地将新字段忽略。然而，未知的字段是没有被抛弃的，此后，如果消息被序列化，未知的字段会随之一起被序列化&mdash;&mdash;所以，如果消息传到了新代码那里，则新的字段仍然可用。注意：对</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt">Python</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:#3333FF;mso-font-kerning:0pt">来说，对未知字段的保留策略是无效的。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:32.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-21.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l12 level1 lfo11"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings;color:#3333FF;mso-font-kerning:0pt"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp;</span></span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">非</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt">required</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">的字段可以移除&mdash;&mdash;只要它们的标识号（</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt">tag number</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:
12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:
Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;mso-font-kerning:0pt">）在你的新消息类型中不再使用（更好的做法可能是重命名那个字段，例如在字段前添加&ldquo;</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt">OBSOLETE_</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:#3333FF;mso-font-kerning:0pt">&rdquo;前缀，那样的话，你的</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt">.proto</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:#3333FF;mso-font-kerning:0pt">文件的用户将来就不会无意中重新使用了那些不该使用的标识号）。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:32.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-21.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l12 level1 lfo11"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings;color:#3333FF;mso-font-kerning:0pt"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp;</span></span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">一个非</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt">required</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">的字段可以转换为一个扩展（</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html#extensions"><span style="color:#0000CC">extension</span></a></span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">），反之亦然&mdash;&mdash;只要它的类型和标识号保持不变。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:32.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-21.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l12 level1 lfo11"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings;color:#3333FF;mso-font-kerning:0pt"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp;</span></span></b><span lang="EN-US" style="font-size:
10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;
mso-font-kerning:0pt">int32</span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">,&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">uint32</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">,&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">int64</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">,&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">uint64</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">,</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">和</span></b><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">bool</span><b style="mso-bidi-font-weight:normal"><span style="font-size:
12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:
Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;mso-font-kerning:0pt">是全部兼容的，这意味着你可以将这些类型中的一个转换为另外一个，而不会破坏前向、后向的兼容性。如果解析出来的数字与对应的类型不相符，那么结果就像在</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt">C++</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:#3333FF;mso-font-kerning:0pt">中对它进行了强制类型转换一样（例如，如果把一个</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt">64</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:#3333FF;mso-font-kerning:0pt">位数字当作</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt">int32</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:#3333FF;mso-font-kerning:0pt">来读取，那么它就会被截断为</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt">32</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:#3333FF;mso-font-kerning:0pt">位的数字）。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:32.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-21.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l12 level1 lfo11"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings;color:#3333FF;mso-font-kerning:0pt"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp;</span></span></b><span lang="EN-US" style="font-size:
10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;
mso-font-kerning:0pt">sint32</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">和</span></b><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">sint64</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">是互相兼容的，但是它们与其他整数类型</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:red;mso-font-kerning:0pt">不兼容</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">。</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:32.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-21.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l12 level1 lfo11"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings;color:#3333FF;mso-font-kerning:0pt"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp;</span></span></b><span lang="EN-US" style="font-size:
10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;
mso-font-kerning:0pt">string</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">和</span></b><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">bytes</span><b style="mso-bidi-font-weight:normal"><span style="font-size:
12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:
Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;mso-font-kerning:0pt">是兼容的&mdash;&mdash;只要</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">bytes</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">是有效的</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt">UTF-8</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">编码。</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:32.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-21.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l12 level1 lfo11"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings;color:#3333FF;mso-font-kerning:0pt"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp;</span></span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">嵌套消息与</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">bytes</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">是兼容的&mdash;&mdash;只要</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt">bytes</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#3333FF;mso-font-kerning:0pt">包含该消息的一个编码过的版本。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:32.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-21.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l12 level1 lfo11"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings;color:#3333FF;mso-font-kerning:0pt"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#3333FF;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp;</span></span></b><span lang="EN-US" style="font-size:
10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;
mso-font-kerning:0pt">fixed32</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">与</span></b><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">sfixed32</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">是兼容的，</span></b><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">fixed64</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">与</span></b><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">sfixed64</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#3333FF;
mso-font-kerning:0pt">是兼容的。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#3333FF;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;text-align:left;
line-height:15.0pt;mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt"><o:p>&nbsp;</o:p></span></p>
<div style="mso-element:para-border-div;border:none;border-top:solid #3366CC 1.0pt;
mso-border-top-alt:solid #3366CC .75pt;padding:1.0pt 0cm 0cm 0cm;background:
#E5ECF9;margin-left:-7.5pt;margin-right:0cm"></p>
<p align="left" class="MsoNormal" style="margin-top:24.0pt;text-align:left;
mso-pagination:widow-orphan;mso-outline-level:2;background:#E5ECF9;border:none;
mso-border-top-alt:solid #3366CC .75pt;padding:0cm;mso-padding-alt:1.0pt 0cm 0cm 0cm"><br />
		<b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">Extensions </span></b><b><span style="font-size:15.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">扩展</span></b><b><span lang="EN-US" style="font-size:15.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
</div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">Extensions let you declare that a range of field numbers in a message are available for third-party extensions. Other people can then declare new fields for your message type with those numeric tags in their own&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">.proto</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;files without having to edit the original file. Let&#39;s look at an example:<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">通过扩展，你可以将一个范围内的字段标识号声明为可被第三方扩展所用。然后，其他人就可以在他们自己的</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">.proto</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">文件中为你的消息类型声明新的字段，而不必去编辑原始文件了。让我们看个例子：</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<div style="mso-element:para-border-div;border:solid #BBBBBB 1.0pt;mso-border-alt:
solid #BBBBBB .75pt;padding:12.0pt 12.0pt 12.0pt 12.0pt;background:#FAFAFA"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">message Foo {<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>// ...<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>extensions 100 to 199;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">}<o:p></o:p></span></p>
</div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">This says that the range of field numbers [100, 199] in&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">Foo</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;is reserved for extensions. Other users can now add new fields to&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">Foo</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;in their own</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">.proto</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;files that import your&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">.proto</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">, using tags within your specified range &ndash; for example:<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">这个例子表明：在消息</span></b><span lang="EN-US" style="font-size:
10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;
mso-font-kerning:0pt">Foo</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">中，范围</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">[100,199]</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">之内的字段标识号被保留为扩展用。现在，其他人就可以在他们自己的</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">.proto</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">文件中添加新字段到</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">Foo</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">里了，但是添加的字段标识号要在指定的范围内&mdash;&mdash;例如：</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<div style="mso-element:para-border-div;border:solid #BBBBBB 1.0pt;mso-border-alt:
solid #BBBBBB .75pt;padding:12.0pt 12.0pt 12.0pt 12.0pt;background:#FAFAFA"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">extend Foo {<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>optional int32 bar = 126;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">}<o:p></o:p></span></p>
</div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">This says that&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">Foo</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;now has an optional&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">int32</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;field called&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">bar</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">When your user&#39;s&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">Foo</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;messages are encoded, the wire format is exactly the same as if the user defined the new field inside&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">Foo</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">. However, the way you access extension fields in your application code is slightly different to accessing regular fields &ndash; your generated data access code has special accessors for working with extensions. So, for example, here&#39;s how you set the value of&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">bar</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;in C++:<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">这个例子表明：消息</span></b><span lang="EN-US" style="font-size:
10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;
mso-font-kerning:0pt">Foo</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">现在有一个名为</span></b><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">bar</span><b style="mso-bidi-font-weight:normal"><span style="font-size:
12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:
Helvetica;mso-bidi-font-family:Helvetica;color:blue;mso-font-kerning:0pt">的</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">optional</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt"> int32</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">字段。</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">当用户的</span></b><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">Foo</span><b style="mso-bidi-font-weight:normal"><span style="font-size:
12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:
Helvetica;mso-bidi-font-family:Helvetica;color:blue;mso-font-kerning:0pt">消息被编码的时候，数据的传输格式与用户在</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">Foo</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">里定义新字段的效果是完全一样的。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">然而，你在程序代码中访问扩展字段的方法与访问普通的字段稍有不同&mdash;&mdash;你生成的数据访问代码为扩展准备了特殊的访问函数来访问它。例如，下面是你如何在</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">C++</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">中设置</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">bar</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">的值：</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt"><o:p></o:p></span></p>
<div style="mso-element:para-border-div;border:solid #BBBBBB 1.0pt;mso-border-alt:
solid #BBBBBB .75pt;padding:12.0pt 12.0pt 12.0pt 12.0pt;background:#FAFAFA"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:black;
mso-font-kerning:0pt">Foo foo</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#666600;mso-font-kerning:
0pt">;</span><br />
		<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;color:black;mso-font-kerning:0pt">foo</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#666600;mso-font-kerning:0pt">.</span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:black;
mso-font-kerning:0pt">SetExtension</span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#666600;
mso-font-kerning:0pt">(</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:black;mso-font-kerning:
0pt">bar</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;color:#666600;mso-font-kerning:0pt">,</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#006666;
mso-font-kerning:0pt">15</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#666600;mso-font-kerning:
0pt">);</span><span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt"><o:p></o:p></span></p>
</div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">Similarly, the&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">Foo</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;class defines templated accessors&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">HasExtension()</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">,&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">ClearExtension()</span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">,&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">GetExtension()</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">,&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">MutableExtension()</span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">, and</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">AddExtension()</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">. All have semantics matching the corresponding generated accessors for a normal field. For more information about working with extensions, see the generated code reference for your chosen language.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">Note that extensions can be of any field type, including message types.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">类似地，</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">Foo</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">类也定义了模板函数</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">HasExtension()</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">，</span></b><span lang="EN-US" style="font-size:
10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;
mso-font-kerning:0pt">ClearExtension()</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">，</span></b><span lang="EN-US" style="font-size:
10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;
mso-font-kerning:0pt">GetExtension()</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">，</span></b><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">MutableExtension()</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">，以及</span></b><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">AddExtension()</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">。这些函数的语义都与对应的普通字段的访问函数相符。要查看更多使用扩展的信息，请参考相应语言的代码生成指南。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">注意：扩展可以是任何字段类型，包括消息类型。</span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span style="color: rgb(255, 255, 255); font-family: arial, helvetica, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-top:18.0pt;text-align:left;
mso-pagination:widow-orphan;mso-outline-level:3"><br />
	<b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">Nested Extensions </span></b><b><span style="font-size:
15.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:
Helvetica;mso-bidi-font-family:Helvetica;color:blue;mso-font-kerning:0pt">嵌套的扩展</span></b><b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">You can declare extensions in the scope of another type:<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">你可以在另一个类型的范围内声明扩展：</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<div style="mso-element:para-border-div;border:solid #BBBBBB 1.0pt;mso-border-alt:
solid #BBBBBB .75pt;padding:12.0pt 12.0pt 12.0pt 12.0pt;background:#FAFAFA"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">message Baz {<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>extend Foo {<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp; </span>optional int32 bar = 126;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>}<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>...<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">}<o:p></o:p></span></p>
</div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">In this case, the C++ code to access this extension is:<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">在此例中，访问此扩展的</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">C++</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">代码是：</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<div style="mso-element:para-border-div;border:solid #BBBBBB 1.0pt;mso-border-alt:
solid #BBBBBB .75pt;padding:12.0pt 12.0pt 12.0pt 12.0pt;background:#FAFAFA"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">Foo foo;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">foo.SetExtension(Baz::bar, 15);<o:p></o:p></span></p>
</div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">In other words, the only effect is that&nbsp;</span><span lang="EN-US" style="font-size:
10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;
mso-font-kerning:0pt">bar</span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">&nbsp;is defined within the scope of&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:
0pt">Baz</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">换句话说，唯一的效果就是</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;color:blue;mso-font-kerning:0pt">bar</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">被定义在</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;color:blue;mso-font-kerning:0pt">Baz</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">的范围内。</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<div style="mso-element:para-border-div;border-top:solid #AA0033 1.0pt;
border-left:none;border-bottom:solid #AA0033 1.0pt;border-right:none;
mso-border-top-alt:solid #AA0033 .75pt;mso-border-bottom-alt:solid #AA0033 .75pt;
padding:2.0pt 0cm 2.0pt 0cm;background:#EFEFEF"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:15.0pt;mso-pagination:widow-orphan;background:#EFEFEF;border:none;
mso-border-top-alt:solid #AA0033 .75pt;mso-border-bottom-alt:solid #AA0033 .75pt;
padding:0cm;mso-padding-alt:2.0pt 0cm 2.0pt 0cm"><br />
		<span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">This is a common source of confusion: Declaring an&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">extend</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;block nested inside a message type&nbsp;</span><b><i><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#AA0033;mso-font-kerning:0pt">does not</span></i></b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;imply any relationship between the outer type and the extended type. In particular, the above example&nbsp;</span><b><i><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#AA0033;mso-font-kerning:0pt">does not</span></i></b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;mean that&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">Baz</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;is any sort of subclass of&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">Foo</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">. All it means is that the symbol&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">bar</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;is declared inside the scope of&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">Baz</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">; it&#39;s simply a static member.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:15.0pt;mso-pagination:widow-orphan;background:#EFEFEF;border:none;
mso-border-top-alt:solid #AA0033 .75pt;mso-border-bottom-alt:solid #AA0033 .75pt;
padding:0cm;mso-padding-alt:2.0pt 0cm 2.0pt 0cm"><br />
		<b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">这是个引起混淆的来源：在一个消息类型中嵌套声明一个</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">extend</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">块并</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:#C00000;mso-font-kerning:0pt">没有</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">暗示外部类型（</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">outer type</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">）与扩展类型（</span></b><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">extended type</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;
font-family:宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;
mso-bidi-font-family:Helvetica;color:blue;mso-font-kerning:0pt">）之间有任何联系。特别地，上面的例子</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:#C00000;mso-font-kerning:0pt">没有</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">表明</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">Baz</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">是</span></b><span lang="EN-US" style="font-size:
10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#007000;
mso-font-kerning:0pt">Foo</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">的任何类型的子类。它所表明的仅仅是：符号</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">bar</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">是在</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">Baz</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">的内部声明的；它只是一个静态成员罢了。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
</div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">A common pattern is to define extensions inside the scope of the extension&#39;s field type &ndash; for example, here&#39;s an extension to&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">Foo</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;of type&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">Baz</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">, where the extension is defined as part of&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">Baz</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">:<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">一个通常的设计模式就是：在扩展的字段类型的范围内定义该扩展&mdash;&mdash;例如，下面是一个</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">Foo</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">的扩展（该扩展是</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">Baz</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">类型的），其中，扩展被定义为了</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
color:#007000;mso-font-kerning:0pt">Baz</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">的一部分：</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">（译者注：这样的定义形式确很容易引起混淆，请继续往下看，以帮助你消除这种混淆）</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<div style="mso-element:para-border-div;border:solid #BBBBBB 1.0pt;mso-border-alt:
solid #BBBBBB .75pt;padding:12.0pt 12.0pt 12.0pt 12.0pt;background:#FAFAFA"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">message Baz {<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>extend Foo {<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp; </span>optional Baz foo_ext = 127;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>}<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>...<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">}<o:p></o:p></span></p>
</div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">However, there is no requirement that an extension with a message type be defined inside that type. You can also do this:<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">然而，并没有强制要求一个消息类型的扩展一定要定义在那个消息中。你也可以这样做：</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<div style="mso-element:para-border-div;border:solid #BBBBBB 1.0pt;mso-border-alt:
solid #BBBBBB .75pt;padding:12.0pt 12.0pt 12.0pt 12.0pt;background:#FAFAFA"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">message Baz {<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>...<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">}<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><o:p>&nbsp;</o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">// This can even be in a different file.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">extend Foo {<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>optional Baz foo_baz_ext = 127;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
		<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;color:#007000;mso-font-kerning:0pt">}<o:p></o:p></span></p>
</div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">In fact, this syntax may be preferred to avoid confusion. As mentioned above, the nested syntax is often mistaken for subclassing by users who are not already familiar with extensions.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
	<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">事实上，这种语法格式更能防止引起混淆。正如上面所提到的，嵌套的语法通常被错误地认为有子类化的关系&mdash;&mdash;尤其是对那些还不熟悉扩展的用户来说。</span></b></p>
<p style="text-align: left;">
	&nbsp;</p>
<p></p>
<h2>
	&nbsp;</h2>
<p><span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;版权声明&nbsp;<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;<br />
转载需注明出处：<u><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><em><span style="color: rgb(0, 0, 255);"><strong style="font-size: 16px;"><span style="font-family: arial, helvetica, sans-serif;">codelast.com</span></strong></span></em></a></u>&nbsp;<br />
感谢关注我的微信公众号（微信扫一扫）：</p>
<p style="border: 0px; font-size: 13px; margin: 0px 0px 9px; outline: 0px; padding: 0px; color: rgb(77, 77, 77);">
	<img decoding="async" alt="wechat qrcode of codelast" src="https://www.codelast.com/codelast_wechat_qr_code.jpg" style="width: 200px; height: 200px;" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codelast.com/%e5%8e%9f%e5%88%9b-language-guide%e4%b8%ad%e6%96%87%e7%bf%bb%e8%af%91%ef%bc%88google-protocol-buffers%e4%b8%ad%e6%96%87%e6%95%99%e7%a8%8b%ef%bc%89/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[原创] Protocol Buffer Basics: C++中文翻译（Google Protocol Buffers中文教程）</title>
		<link>https://www.codelast.com/%e5%8e%9f%e5%88%9b-protocol-buffer-basics-c%e4%b8%ad%e6%96%87%e7%bf%bb%e8%af%91%ef%bc%88google-protocol-buffers%e4%b8%ad%e6%96%87%e6%95%99%e7%a8%8b%ef%bc%89/</link>
					<comments>https://www.codelast.com/%e5%8e%9f%e5%88%9b-protocol-buffer-basics-c%e4%b8%ad%e6%96%87%e7%bf%bb%e8%af%91%ef%bc%88google-protocol-buffers%e4%b8%ad%e6%96%87%e6%95%99%e7%a8%8b%ef%bc%89/#respond</comments>
		
		<dc:creator><![CDATA[learnhard]]></dc:creator>
		<pubDate>Tue, 14 Sep 2010 05:04:12 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[Basics]]></category>
		<category><![CDATA[Buffer]]></category>
		<category><![CDATA[Google Protocol Buffers]]></category>
		<category><![CDATA[Protocol]]></category>
		<category><![CDATA[中文]]></category>
		<category><![CDATA[教程]]></category>
		<category><![CDATA[翻译]]></category>
		<guid isPermaLink="false">http://www.codelast.com/?p=280</guid>

					<description><![CDATA[<h2>
	<b><span style="font-size:20.5pt;Helvetica&#34;,&#34;sans-serif&#34;;
color:black;">Protocol Buffer Basics: C++</span></b><b><span style="font-size:20.5pt;color:blue;">（</span></b><b><span style="font-size:20.5pt;Helvetica&#34;,&#34;sans-serif&#34;;color:blue;">Protocol Buffer</span></b><b><span style="font-size:20.5pt;
color:blue;">基础：</span></b><b><span style="font-size:20.5pt;Helvetica&#34;,&#34;sans-serif&#34;;color:blue;">C++</span></b><b><span style="font-size:20.5pt;color:blue;">篇）</span></b></h2>
<div align="left" style="margin-left:-7.5pt;text-align:left;
line-height:26.25pt;"><br />
	<font class="Apple-style-span" color="#0000FF">注：这是本人的翻译，可能不准确，可能有错误，但是基本上可以理解，希望能对大家有所帮助！（</font><strong><span style="color:#ff0000;"><font class="Apple-style-span">转载需注明出处</font></span></strong><font class="Apple-style-span" color="#0000FF">：本文来自learnhard的博客：<span style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; color: rgb(0, 0, 255); "><a href="http://www.codelast.com/" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: rgb(0, 77, 153); border-style: initial; border-color: initial; " target="_blank" rel="noopener noreferrer">http://www.codelast.com/</a>&#160;</span>&#38;&#160;<a href="http://blog.csdn.net/learnhard/" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: rgb(0, 77, 153); border-style: initial; border-color: initial; "><span style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; color: rgb(0, 0, 255); ">http://blog.csdn.net/learnhard/</span></a>）</font></div>
<div align="left" style="margin-left:-7.5pt;text-align:left;
line-height:26.25pt;"><br />
<span id="more-280"></span></div>
<div align="left" style="margin-left:-7.5pt;text-align:left;
line-height:26.25pt;">
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:&#34;Helvetica&#34;,&#34;sans-serif&#34;;color:black;mso-font-kerning:0pt">This tutorial provides a basic C++ programmer&#39;s introduction to working with protocol buffers. By walking through creating a simple example application, it shows you how to<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l18 level1 lfo1;tab-stops:list 36.0pt"><br />
		<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&#183;<span style="font:7.0pt &#34;Times New Roman&#34;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&#34;Helvetica&#34;,&#34;sans-serif&#34;;color:black;mso-font-kerning:0pt">Define message formats in a&#160;</span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&#34;Courier New&#34;;mso-bidi-font-family:宋体;
color:#007000;mso-font-kerning:0pt">.proto</span></p></div>&#8230; <a href="https://www.codelast.com/%e5%8e%9f%e5%88%9b-protocol-buffer-basics-c%e4%b8%ad%e6%96%87%e7%bf%bb%e8%af%91%ef%bc%88google-protocol-buffers%e4%b8%ad%e6%96%87%e6%95%99%e7%a8%8b%ef%bc%89/" class="read-more">Read More </a>]]></description>
										<content:encoded><![CDATA[<h2>
	<b><span style="font-size:20.5pt;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;">Protocol Buffer Basics: C++</span></b><b><span style="font-size:20.5pt;color:blue;">（</span></b><b><span style="font-size:20.5pt;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;">Protocol Buffer</span></b><b><span style="font-size:20.5pt;
color:blue;">基础：</span></b><b><span style="font-size:20.5pt;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;">C++</span></b><b><span style="font-size:20.5pt;color:blue;">篇）</span></b></h2>
<div align="left" style="margin-left:-7.5pt;text-align:left;
line-height:26.25pt;"><br />
	<font class="Apple-style-span" color="#0000FF">注：这是本人的翻译，可能不准确，可能有错误，但是基本上可以理解，希望能对大家有所帮助！（</font><strong><span style="color:#ff0000;"><font class="Apple-style-span">转载需注明出处</font></span></strong><font class="Apple-style-span" color="#0000FF">：本文来自learnhard的博客：<span style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; color: rgb(0, 0, 255); "><a href="http://www.codelast.com/" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: rgb(0, 77, 153); border-style: initial; border-color: initial; " target="_blank" rel="noopener noreferrer">http://www.codelast.com/</a>&nbsp;</span>&amp;&nbsp;<a href="http://blog.csdn.net/learnhard/" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: rgb(0, 77, 153); border-style: initial; border-color: initial; "><span style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; color: rgb(0, 0, 255); ">http://blog.csdn.net/learnhard/</span></a>）</font></div>
<div align="left" style="margin-left:-7.5pt;text-align:left;
line-height:26.25pt;"><br />
<span id="more-280"></span></div>
<div align="left" style="margin-left:-7.5pt;text-align:left;
line-height:26.25pt;"></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">This tutorial provides a basic C++ programmer&#39;s introduction to working with protocol buffers. By walking through creating a simple example application, it shows you how to<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l18 level1 lfo1;tab-stops:list 36.0pt"><br />
		<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">Define message formats in a&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#007000;mso-font-kerning:0pt">.proto</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;file.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l18 level1 lfo1;tab-stops:list 36.0pt"><br />
		<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">Use the protocol buffer compiler.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l18 level1 lfo1;tab-stops:list 36.0pt"><br />
		<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">Use the C++ protocol buffer API to write and read messages.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;text-align:left;
line-height:15.0pt;mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">本教程提供了面向</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">C++</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">程序员的</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">protocol buffers</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">的基本介绍。通过创建一个简单的示例程序，它教你如何：</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:21.0pt;margin-bottom:.0001pt;text-align:left;
text-indent:-21.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l8 level1 lfo12"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings;color:blue;mso-font-kerning:0pt"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">定义</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">.proto</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">文件的消息格式。</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:21.0pt;margin-bottom:.0001pt;text-align:left;
text-indent:-21.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l8 level1 lfo12"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings;color:blue;mso-font-kerning:0pt"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">使用</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">protocol buffer</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">的编译器。</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:21.0pt;margin-bottom:.0001pt;text-align:left;
text-indent:-21.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l8 level1 lfo12"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings;color:blue;mso-font-kerning:0pt"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">使用</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">protoco buffer</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">的</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">C++ API</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">来读写消息。</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;text-align:left;
line-height:15.0pt;mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt"><o:p>&nbsp;</o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">This isn&#39;t a comprehensive guide to using protocol buffers in C++. For more detailed reference information, see the&nbsp;<a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html"><span style="color:#0000CC">Protocol Buffer Language Guide</span></a>, the&nbsp;<a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/reference/cpp/index.html"><span style="color:#0000CC">C++ API Reference</span></a>, the&nbsp;<a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/reference/cpp-generated.html"><span style="color:#0000CC">C++ Generated Code Guide</span></a>, and the&nbsp;<a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/encoding.html"><span style="color:#0000CC">Encoding Reference</span></a>.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;text-align:left;
line-height:15.0pt;mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">本文并不是关于</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">protocol buffers</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">的</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">C++</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">使用的全面教程。要查看更详细的参考资料，请阅如下文章：</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html"><span style="color:#0000CC">Protocol Buffer Language Guide</span></a></span><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:black;
mso-font-kerning:0pt">，</span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/reference/cpp/index.html"><span style="color:#0000CC">C++ API Reference</span></a></span><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:black;
mso-font-kerning:0pt">，</span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/reference/cpp-generated.html"><span style="color:#0000CC">C++ Generated Code Guide</span></a></span><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:black;
mso-font-kerning:0pt">，</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">以及</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">&nbsp;</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/encoding.html"><span style="color:#0000CC">Encoding Reference</span></a></span><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:black;
mso-font-kerning:0pt">。</span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;text-align:left;
line-height:15.0pt;mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<div style="mso-element:para-border-div;border:none;border-top:solid #3366CC 1.0pt;
mso-border-top-alt:solid #3366CC .75pt;padding:1.0pt 0cm 0cm 0cm;background:
#E5ECF9;margin-left:-7.5pt;margin-right:0cm"></p>
<p align="left" class="MsoNormal" style="margin-top:24.0pt;text-align:left;
mso-pagination:widow-orphan;mso-outline-level:2;background:#E5ECF9;border:none;
mso-border-top-alt:solid #3366CC .75pt;padding:0cm;mso-padding-alt:1.0pt 0cm 0cm 0cm"><br />
			<b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">Why Use Protocol Buffers? </span></b><b><span style="font-size:15.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">为什么要使用</span></b><b><span lang="EN-US" style="font-size:
15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">protocol buffers</span></b><b><span style="font-size:15.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">？</span></b><b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt"><o:p></o:p></span></b></p>
</p></div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">The example we&#39;re going to use is a very simple &quot;address book&quot; application that can read and write people&#39;s contact details to and from a file. Each person in the address book has a name, an ID, an email address, and a contact phone number.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">How do you serialize and retrieve structured data like this? There are a few ways to solve this problem:<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l3 level1 lfo2;tab-stops:list 36.0pt"><br />
		<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">The raw in-memory data structures can be sent/saved in binary form. Over time, this is a fragile approach, as the receiving/reading code must be compiled with exactly the same memory layout, endianness, etc. Also, as files accumulate data in the raw format and copies of software that are wired for that format are spread around, it&#39;s very hard to extend the format.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l3 level1 lfo2;tab-stops:list 36.0pt"><br />
		<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">You can invent an ad-hoc way to encode the data items into a single string &ndash; such as encoding 4 ints as &quot;12:3:-23:67&quot;. This is a simple and flexible approach, although it does require writing one-off encoding and parsing code, and the parsing imposes a small run-time cost. This works best for encoding very simple data.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l3 level1 lfo2;tab-stops:list 36.0pt"><br />
		<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">Serialize the data to XML. This approach can be very attractive since XML is (sort of) human readable and there are binding libraries for lots of languages. This can be a good choice if you want to share data with other applications/projects. However, XML is notoriously space intensive, and encoding/decoding it can impose a huge performance penalty on applications. Also, navigating an XML DOM tree is considerably more complicated than navigating simple fields in a class normally would be.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">Protocol buffers are the flexible, efficient, automated solution to solve exactly this problem. With protocol buffers, you write a&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">.proto</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;description of the data structure you wish to store. From that, the protocol buffer compiler creates a class that implements automatic encoding and parsing of the protocol buffer data with an efficient binary format. The generated class provides getters and setters for the fields that make up a protocol buffer and takes care of the details of reading and writing the protocol buffer as a unit. Importantly, the protocol buffer format supports the idea of extending the format over time in such a way that the code can still read data encoded with the old format.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">（这一段不翻译了，没意思）</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<div style="mso-element:para-border-div;border:none;border-top:solid #3366CC 1.0pt;
mso-border-top-alt:solid #3366CC .75pt;padding:1.0pt 0cm 0cm 0cm;background:
#E5ECF9;margin-left:-7.5pt;margin-right:0cm"></p>
<p align="left" class="MsoNormal" style="margin-top:24.0pt;text-align:left;
mso-pagination:widow-orphan;mso-outline-level:2;background:#E5ECF9;border:none;
mso-border-top-alt:solid #3366CC .75pt;padding:0cm;mso-padding-alt:1.0pt 0cm 0cm 0cm"><br />
			<b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">Where to Find the Example Code </span></b><b><span style="font-size:15.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">在哪可以找到示例代码</span></b><b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt"><o:p></o:p></span></b></p>
</p></div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">The example code is included in the source code package, under the &quot;examples&quot; directory.&nbsp;<a href="http://code.google.com/p/protobuf/downloads/"><span style="color:#0000CC">Download it here.</span></a><o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">示例代码包含在源代码包中的&ldquo;</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">examples</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">&rdquo;目录下。</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><a href="http://code.google.com/p/protobuf/downloads/"><span lang="EN-US" style="font-family:宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:
Helvetica"><span lang="EN-US">点<span lang="EN-US">击<span lang="EN-US">此处下载</span></span></span></span></a></span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">。</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<div style="mso-element:para-border-div;border:none;border-top:solid #3366CC 1.0pt;
mso-border-top-alt:solid #3366CC .75pt;padding:1.0pt 0cm 0cm 0cm;background:
#E5ECF9;margin-left:-7.5pt;margin-right:0cm"></p>
<p align="left" class="MsoNormal" style="margin-top:24.0pt;text-align:left;
mso-pagination:widow-orphan;mso-outline-level:2;background:#E5ECF9;border:none;
mso-border-top-alt:solid #3366CC .75pt;padding:0cm;mso-padding-alt:1.0pt 0cm 0cm 0cm"><br />
			<b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">Defining Your Protocol Format </span></b><b><span style="font-size:15.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">定义你自己的协议格式</span></b><b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt"><o:p></o:p></span></b></p>
</p></div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">To create your address book application, you&#39;ll need to start with a&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">.proto</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;file. The definitions in a&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">.proto</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;file are simple: you add a&nbsp;<i>message</i>&nbsp;for each data structure you want to serialize, then specify a name and a type for each field in the message. Here is the&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">.proto</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;file that defines your messages,&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">addressbook.proto</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">要创建你的地址薄应用程序，你需要从编写一个</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">.proto</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">文件开始。</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">.proto</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">文件的定义是比较简单的：为每一个你需要序列化的数据结构添加一个消息（</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">message</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">），然后为消息（</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">message</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">）中的每一个字段（</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">field</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">）指定一个名字和一个类型。下面就是一个定义你的多个消息（</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">messages</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">）的文件</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">addressbook.proto</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">：</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<div style="mso-element:para-border-div;border:solid #BBBBBB 1.0pt;mso-border-alt:
solid #BBBBBB .75pt;padding:12.0pt 12.0pt 12.0pt 12.0pt;background:#FAFAFA"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
			<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#007000;
mso-font-kerning:0pt">package tutorial;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
			<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#007000;
mso-font-kerning:0pt"><o:p>&nbsp;</o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
			<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#007000;
mso-font-kerning:0pt">message Person {<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
			<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#007000;
mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>required string name = 1;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
			<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#007000;
mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>required int32 id = 2;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
			<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#007000;
mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>optional string email = 3;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
			<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#007000;
mso-font-kerning:0pt"><o:p>&nbsp;</o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
			<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#007000;
mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>enum PhoneType {<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
			<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#007000;
mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp; </span>MOBILE = 0;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
			<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#007000;
mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp; </span>HOME = 1;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
			<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#007000;
mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp; </span>WORK = 2;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
			<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#007000;
mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>}<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
			<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#007000;
mso-font-kerning:0pt"><o:p>&nbsp;</o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
			<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#007000;
mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>message PhoneNumber {<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
			<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#007000;
mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp; </span>required string number = 1;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
			<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#007000;
mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp;&nbsp;&nbsp; </span>optional PhoneType type = 2 [default = HOME];<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
			<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#007000;
mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>}<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
			<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#007000;
mso-font-kerning:0pt"><o:p>&nbsp;</o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
			<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#007000;
mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>repeated PhoneNumber phone = 4;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
			<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#007000;
mso-font-kerning:0pt">}<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
			<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#007000;
mso-font-kerning:0pt"><o:p>&nbsp;</o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
			<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#007000;
mso-font-kerning:0pt">message AddressBook {<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
			<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#007000;
mso-font-kerning:0pt"><span style="mso-spacerun:yes">&nbsp; </span>repeated Person person = 1;<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
			<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#007000;
mso-font-kerning:0pt">}<o:p></o:p></span></p>
</p></div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">As you can see, the syntax is similar to C++ or Java. Let&#39;s go through each part of the file and see what it does.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">正如你所看到的一样，该语法类似于</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">C++</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">或</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">Java</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">的语法。让我们依次来看看文件的每一部分的作用。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p>&nbsp;</o:p></span></b><span lang="EN-US" style="line-height: 15pt; font-size: 12pt; font-family: Helvetica, sans-serif; ">The&nbsp;</span><span lang="EN-US" style="line-height: 15pt; font-size: 10pt; font-family: 'Courier New'; color: rgb(0, 112, 0); ">.proto</span><span lang="EN-US" style="line-height: 15pt; font-size: 12pt; font-family: Helvetica, sans-serif; ">&nbsp;file starts with a package declaration, which helps to prevent naming conflicts between different projects. In C++, your generated classes will be placed in a namespace matching the package name.</span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">.proto</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">文件以一个</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">package</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">声明开始。这个声明是为了防止不同项目之间的命名冲突。对应到</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">C++</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">中去，你用这个</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">.proto</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">文件生成的类将被放置在一个与</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">package</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">名相同的命名空间中。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span style="color: rgb(255, 255, 255); font-family: arial, helvetica, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="line-height: 15pt; font-size: 12pt; font-family: Helvetica, sans-serif; ">Next, you have your message definitions. A message is just an aggregate containing a set of typed fields. Many standard simple data types are available as field types, including&nbsp;</span><span lang="EN-US" style="line-height: 15pt; font-size: 10pt; font-family: 'Courier New'; color: rgb(0, 112, 0); ">bool</span><span lang="EN-US" style="line-height: 15pt; font-size: 12pt; font-family: Helvetica, sans-serif; ">,&nbsp;</span><span lang="EN-US" style="line-height: 15pt; font-size: 10pt; font-family: 'Courier New'; color: rgb(0, 112, 0); ">int32</span><span lang="EN-US" style="line-height: 15pt; font-size: 12pt; font-family: Helvetica, sans-serif; ">,&nbsp;</span><span lang="EN-US" style="line-height: 15pt; font-size: 10pt; font-family: 'Courier New'; color: rgb(0, 112, 0); ">float</span><span lang="EN-US" style="line-height: 15pt; font-size: 12pt; font-family: Helvetica, sans-serif; ">,&nbsp;</span><span lang="EN-US" style="line-height: 15pt; font-size: 10pt; font-family: 'Courier New'; color: rgb(0, 112, 0); ">double</span><span lang="EN-US" style="line-height: 15pt; font-size: 12pt; font-family: Helvetica, sans-serif; ">, and&nbsp;</span><span lang="EN-US" style="line-height: 15pt; font-size: 10pt; font-family: 'Courier New'; color: rgb(0, 112, 0); ">string</span><span lang="EN-US" style="line-height: 15pt; font-size: 12pt; font-family: Helvetica, sans-serif; ">. You can also add further structure to your messages by using other message types as field types &ndash; in the above example the&nbsp;</span><span lang="EN-US" style="line-height: 15pt; font-size: 10pt; font-family: 'Courier New'; color: rgb(0, 112, 0); ">Person</span><span lang="EN-US" style="line-height: 15pt; font-size: 12pt; font-family: Helvetica, sans-serif; ">&nbsp;message contains&nbsp;</span><span lang="EN-US" style="line-height: 15pt; font-size: 10pt; font-family: 'Courier New'; color: rgb(0, 112, 0); ">PhoneNumber</span><span lang="EN-US" style="line-height: 15pt; font-size: 12pt; font-family: Helvetica, sans-serif; ">&nbsp;messages, while the&nbsp;</span><span lang="EN-US" style="line-height: 15pt; font-size: 10pt; font-family: 'Courier New'; color: rgb(0, 112, 0); ">AddressBook</span><span lang="EN-US" style="line-height: 15pt; font-size: 12pt; font-family: Helvetica, sans-serif; ">&nbsp;message contains&nbsp;</span><span lang="EN-US" style="line-height: 15pt; font-size: 10pt; font-family: 'Courier New'; color: rgb(0, 112, 0); ">Person</span><span lang="EN-US" style="line-height: 15pt; font-size: 12pt; font-family: Helvetica, sans-serif; ">&nbsp;messages. You can even define message types nested inside other messages &ndash; as you can see, the&nbsp;</span><span lang="EN-US" style="line-height: 15pt; font-size: 10pt; font-family: 'Courier New'; color: rgb(0, 112, 0); ">PhoneNumber</span><span lang="EN-US" style="line-height: 15pt; font-size: 12pt; font-family: Helvetica, sans-serif; ">&nbsp;type is defined inside&nbsp;</span><span lang="EN-US" style="line-height: 15pt; font-size: 10pt; font-family: 'Courier New'; color: rgb(0, 112, 0); ">Person</span><span lang="EN-US" style="line-height: 15pt; font-size: 12pt; font-family: Helvetica, sans-serif; ">. You can also define&nbsp;</span><span lang="EN-US" style="line-height: 15pt; font-size: 10pt; font-family: 'Courier New'; color: rgb(0, 112, 0); ">enum</span><span lang="EN-US" style="line-height: 15pt; font-size: 12pt; font-family: Helvetica, sans-serif; ">&nbsp;types if you want one of your fields to have one of a predefined list of values &ndash; here you want to specify that a phone number can be one of&nbsp;</span><span lang="EN-US" style="line-height: 15pt; font-size: 10pt; font-family: 'Courier New'; color: rgb(0, 112, 0); ">MOBILE</span><span lang="EN-US" style="line-height: 15pt; font-size: 12pt; font-family: Helvetica, sans-serif; ">,&nbsp;</span><span lang="EN-US" style="line-height: 15pt; font-size: 10pt; font-family: 'Courier New'; color: rgb(0, 112, 0); ">HOME</span><span lang="EN-US" style="line-height: 15pt; font-size: 12pt; font-family: Helvetica, sans-serif; ">, or&nbsp;</span><span lang="EN-US" style="line-height: 15pt; font-size: 10pt; font-family: 'Courier New'; color: rgb(0, 112, 0); ">WORK</span><span lang="EN-US" style="line-height: 15pt; font-size: 12pt; font-family: Helvetica, sans-serif; ">.</span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">再往下看，就是若干消息（</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">message</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">）定义了。一个消息就是某些类型的字段的集合。许多标准的、简单的数据类型都可以用作字段类型，包括</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">bool</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">，</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">int32</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">，</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">float</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">，</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">double</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">，以及</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">string</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">。你也可以使用其他的消息（</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">message</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">）类型来作为你的字段类型&mdash;&mdash;在上面的例子中，消息</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">Person</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">就是一个被用作字段类型的例子。</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt"><o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><o:p>&nbsp;</o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">The &quot; = 1&quot;, &quot; = 2&quot; markers on each element identify the unique &quot;tag&quot; that field uses in the binary encoding. Tag numbers 1-15 require one less byte to encode than higher numbers, so as an optimization you can decide to use those tags for the commonly used or repeated elements, leaving tags 16 and higher for less-commonly used optional elements. Each element in a repeated field requires re-encoding the tag number, so repeated fields are particularly good candidates for this optimization.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">在每一项后面的、类似于&ldquo;</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">= 1</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">&rdquo;，&ldquo;</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">= 2</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">&rdquo;的标志指出了该字段在二进制编码中使用的唯一&ldquo;标识（</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">tag</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">）&rdquo;。标识号</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">1~15</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">编码所需的字节数比更大的标识号使用的字节数要少</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">1</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">个，所以，如果你想寻求优化，可以为经常使用或者重复的项采用</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">1~15</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">的标识（</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">tag</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">），其他经常使用的</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">optional</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">项采用&ge;</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">16</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">的标识（</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">tag</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">）。在重复的字段中，每一项都要求重编码标识号（</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">tag number</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:
12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:
Helvetica;mso-bidi-font-family:Helvetica;color:blue;mso-font-kerning:0pt">），所以重复的字段特别适用于这种优化情况。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><o:p>&nbsp;</o:p></span><span style="font-family: Helvetica, sans-serif; font-size: 12pt; line-height: 15pt; ">Each field must be annotated with one of the following modifiers:</span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l4 level1 lfo3;tab-stops:list 36.0pt"><br />
		<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#007000;mso-font-kerning:0pt">required</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">: a value for the field must be provided, otherwise the message will be considered &quot;uninitialized&quot;. If&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">libprotobuf</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;is compiled in debug mode, serializing an uninitialized message will cause an assertion failure. In optimized builds, the check is skipped and the message will be written anyway. However, parsing an uninitialized message will always fail (by returning&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">false</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;from the parse method). Other than this, a required field behaves exactly like an optional field.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l4 level1 lfo3;tab-stops:list 36.0pt"><br />
		<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#007000;mso-font-kerning:0pt">optional</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">: the field may or may not be set. If an optional field value isn&#39;t set, a default value is used. For simple types, you can specify your own default value, as we&#39;ve done for the phone number&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">type</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;in the example. Otherwise, a system default is used: zero for numeric types, the empty string for strings, false for bools. For embedded messages, the default value is always the &quot;default instance&quot; or &quot;prototype&quot; of the message, which has none of its fields set. Calling the accessor to get the value of an optional (or required) field which has not been explicitly set always returns that field&#39;s default value.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l4 level1 lfo3;tab-stops:list 36.0pt"><br />
		<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#007000;mso-font-kerning:0pt">repeated</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">: the field may be repeated any number of times (including zero). The order of the repeated values will be preserved in the protocol buffer. Think of repeated fields as dynamically sized arrays.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">每一个字段都必须用以下之一的修饰符来修饰：</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-left:21.0pt;text-align:left;
text-indent:-21.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l0 level1 lfo11"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings;color:blue;mso-font-kerning:0pt"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:red;mso-font-kerning:0pt">required</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">：必须提供字段值，否则对应的消息就会被认为是&ldquo;未初始化的&rdquo;。如果</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">libprotobuf</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">是以</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">debug</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">模式编译的，序列化一个未初始化的消息（</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">message</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">）将会导致一个断言错误。在优化过的编译情况下（译者注：例如</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">release</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">），该检查会被跳过，消息会被写入。然而，解析一个未初始化的消息仍然会失败（解析函数会返回</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">false</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">）。除此之外，一个</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">required</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">的字段与一个</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">optional</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">的字段就没有区别了。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-left:21.0pt;text-align:left;
text-indent:-21.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l0 level1 lfo11"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings;color:blue;mso-font-kerning:0pt"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:red;mso-font-kerning:0pt">optional</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">：字段值指定与否都可以。如果没有指定一个</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">optional</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">的字段值，它就会使用默认值。对简单类型来说，你可以指定你自己的默认值，就像我们在上面的例子中对</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">phone number</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:
12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:
Helvetica;mso-bidi-font-family:Helvetica;color:blue;mso-font-kerning:0pt">的</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">type</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">字段所做的一样。如果你不指定默认值，就会使用系统默认值：数据类型的默认值为</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">0</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">，</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">string</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">的默认值为空字符串，</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">bool</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">的默认值为</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">false</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">。对嵌套消息（</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">message</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">）来说，其默认值总是消息的&ldquo;默认实例&rdquo;或&ldquo;原型&rdquo;，即：没有任何一个字段是指定了值的。调用访问类来取一个未显式指定其值的</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">optional</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">（或者</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">required</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">）的字段的值，总是会返回字段的默认值。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-left:21.0pt;text-align:left;
text-indent:-21.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l0 level1 lfo11"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings;color:blue;mso-font-kerning:0pt"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:red;mso-font-kerning:0pt">repeated</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">：字段会重复</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">N</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">次（</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">N</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">可以为</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">0</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">）。重复的值的顺序将被保存在</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">protocol buffer</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">中。你只要将重复的字段视为动态大小的数组就可以了。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<div style="mso-element:para-border-div;border-top:solid #FFCC33 1.0pt;
border-left:none;border-bottom:solid #FFCC33 1.0pt;border-right:none;
mso-border-top-alt:solid #FFCC33 .75pt;mso-border-bottom-alt:solid #FFCC33 .75pt;
padding:2.0pt 0cm 2.0pt 0cm;background:#EFEFEF"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:15.0pt;mso-pagination:widow-orphan;background:#EFEFEF;border:none;
mso-border-top-alt:solid #FFCC33 .75pt;mso-border-bottom-alt:solid #FFCC33 .75pt;
padding:0cm;mso-padding-alt:2.0pt 0cm 2.0pt 0cm"><br />
			<b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">Required Is Forever</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;You should be very careful about marking fields as&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#007000;
mso-font-kerning:0pt">required</span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">. If at some point you wish to stop writing or sending a required field, it will be problematic to change the field to an optional field &ndash; old readers will consider messages without this field to be incomplete and may reject or drop them unintentionally. You should consider writing application-specific custom validation routines for your buffers instead. Some engineers at Google have come to the conclusion that using&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">required</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;does more harm than good; they prefer to use only</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#007000;
mso-font-kerning:0pt">optional</span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">&nbsp;and&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">repeated</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">. However, this view is not universal.<o:p></o:p></span></p>
</p></div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">required</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">是永久性的：在把一个字段标识为</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">required</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">的时候，你应该特别小心。如果在某些情况下你不想写入或者发送一个</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">required</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">的字段，那么将该字段更改为</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">optional</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">可能会遇到问题&mdash;&mdash;旧版本的读者（译者注：即读取、解析消息的一方）会认为不含该字段的消息（</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">message</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">）是不完整的，从而有可能会拒绝解析。在这种情况下，你应该考虑编写特别针对于应用程序的、自定义的消息校验函数。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">Google</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">的一些工程师得出了一个结论：使用</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">required</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">弊多于利；他们更愿意使用</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">optional</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">和</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">repeated</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">而不是</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">required</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">。当然，这个观点并不具有普遍性。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span style="color: rgb(255, 255, 255); font-family: arial, helvetica, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="line-height: 15pt; font-size: 12pt; font-family: Helvetica, sans-serif; ">You&#39;ll find a complete guide to writing&nbsp;</span><span lang="EN-US" style="line-height: 15pt; font-size: 10pt; font-family: 'Courier New'; color: rgb(0, 112, 0); ">.proto</span><span lang="EN-US" style="line-height: 15pt; font-size: 12pt; font-family: Helvetica, sans-serif; ">&nbsp;files &ndash; including all the possible field types &ndash; in the&nbsp;<a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html"><span style="color:#0000CC">Protocol Buffer Language Guide</span></a>. Don&#39;t go looking for facilities similar to class inheritance, though &ndash; protocol buffers don&#39;t do that.</span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">你可以在</span></b><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html"><span style="color:#0000CC">Protocol Buffer Language Guide</span></a></span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">一文中找到编写</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">.proto</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">文件的完整指南（包括所有可能的字段类型）。但是，不要想在里面找到与类继承相似的特性，因为</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">protocol buffers</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">不是拿来做这个的。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<div style="mso-element:para-border-div;border:none;border-top:solid #3366CC 1.0pt;
mso-border-top-alt:solid #3366CC .75pt;padding:1.0pt 0cm 0cm 0cm;background:
#E5ECF9;margin-left:-7.5pt;margin-right:0cm"></p>
<p align="left" class="MsoNormal" style="margin-top:24.0pt;text-align:left;
mso-pagination:widow-orphan;mso-outline-level:2;background:#E5ECF9;border:none;
mso-border-top-alt:solid #3366CC .75pt;padding:0cm;mso-padding-alt:1.0pt 0cm 0cm 0cm"><br />
			<b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">Compiling Your Protocol Buffers </span></b><b><span style="font-size:15.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:black;
mso-font-kerning:0pt">编译你的</span></b><b><span lang="EN-US" style="font-size:15.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">protocol buffers<o:p></o:p></span></b></p>
</p></div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">Now that you have a&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#007000;
mso-font-kerning:0pt">.proto</span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">, the next thing you need to do is generate the classes you&#39;ll need to read and write&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#007000;
mso-font-kerning:0pt">AddressBook</span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">&nbsp;(and hence&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#007000;
mso-font-kerning:0pt">Person</span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">and&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">PhoneNumber</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">) messages. To do this, you need to run the protocol buffer compiler&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#007000;mso-font-kerning:0pt">protoc</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;on your&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">.proto</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">:<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l12 level1 lfo4;tab-stops:list 36.0pt"><br />
		<span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;mso-fareast-font-family:
Helvetica;color:black;mso-font-kerning:0pt"><span style="mso-list:Ignore">1.<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">If you haven&#39;t installed the compiler,&nbsp;<a href="http://code.google.com/p/protobuf/downloads/"><span style="color:#0000CC">download the package</span></a>&nbsp;and follow the instructions in the README.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l12 level1 lfo4;tab-stops:list 36.0pt"><br />
		<span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;mso-fareast-font-family:
Helvetica;color:black;mso-font-kerning:0pt"><span style="mso-list:Ignore">2.<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">Now run the compiler, specifying the source directory (where your application&#39;s source code lives &ndash; the current directory is used if you don&#39;t provide a value), the destination directory (where you want the generated code to go; often the same as&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">$SRC_DIR</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">), and the path to your</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">.proto</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">. In this case, you...:<o:p></o:p></span></p>
<div style="mso-element:para-border-div;border:solid #BBBBBB 1.0pt;mso-border-alt:
solid #BBBBBB .75pt;padding:12.0pt 12.0pt 12.0pt 12.0pt;background:#FAFAFA;
margin-left:29.25pt;margin-right:0cm"></p>
<p align="left" class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;
margin-bottom:7.2pt;margin-left:0cm;text-align:left;line-height:12.75pt;
mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
			<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#007000;
mso-font-kerning:0pt">protoc -I=$SRC_DIR --cpp_out=$DST_DIR $SRC_DIR/addressbook.proto<o:p></o:p></span></p>
</p></div>
<p align="left" class="MsoNormal" style="margin-left:29.25pt;text-align:left;
line-height:15.0pt;mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">Because you want C++ classes, you use the&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">--cpp_out</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;option &ndash; similar options are provided for other supported languages.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">This generates the following files in your specified destination directory:<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l15 level1 lfo5;tab-stops:list 36.0pt"><br />
		<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#007000;mso-font-kerning:0pt">addressbook.pb.h</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">, the header which declares your generated classes.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l15 level1 lfo5;tab-stops:list 36.0pt"><br />
		<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#007000;mso-font-kerning:0pt">addressbook.pb.cc</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">, which contains the implementation of your classes.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">在得到了一个</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">.proto</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">文件之后，下一步你就要生成可以读写</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">AddressBook</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">消息（当然也就包括了</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">Person</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">以及</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">PhoneNumber</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">消息）的类了。此时你需要运行</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">protocol buffer</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">编译器来编译你的</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">.proto</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">文件：</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">1. </span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">如果你还没有安装该编译器，</span></b><u><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:#0000CC;
mso-font-kerning:0pt">下载安装包</span></u><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">&nbsp;</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">并参照</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">README</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">文件中的说明来安装</span></b><span style="font-size:
12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:
Helvetica;mso-bidi-font-family:Helvetica;color:black;mso-font-kerning:0pt">。</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt"><o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">2. </span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">安装了之后，就可以运行编译器了。指定源目录（即你的应用程序源代码所在的目录&mdash;&mdash;如果不指定的话，就使用当前目录）、目标目录（即生成的代码放置的目录，通常与</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">$SRC_DIR</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">是一样的），以及你的</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">.proto</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">文件所在的目录。在我们这里，可以这样用：</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<div style="mso-element:para-border-div;border:solid #BBBBBB 1.0pt;mso-border-alt:
solid #BBBBBB .75pt;padding:12.0pt 12.0pt 12.0pt 12.0pt;background:#FAFAFA;
margin-left:29.25pt;margin-right:0cm"></p>
<p align="left" class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;
margin-bottom:7.2pt;margin-left:0cm;text-align:left;line-height:12.75pt;
mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
			<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#007000;
mso-font-kerning:0pt">protoc -I=$SRC_DIR --cpp_out=$DST_DIR $SRC_DIR/addressbook.proto<o:p></o:p></span></p>
</p></div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">因为需要生成的是</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">C++</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">类，所以使用了</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">--cpp_out</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">选项参数&mdash;&mdash;</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">protocol buffers</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">也为其他支持的语言提供了类似的选项参数。这样就可以在你指定的目标目录下生成如下文件：</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-left:21.0pt;text-align:left;
text-indent:-21.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l6 level1 lfo13"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings;color:blue;mso-font-kerning:0pt"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:red;mso-font-kerning:0pt">addressbook.pb.h</span><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:&quot;Courier New&quot;;
mso-hansi-font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;mso-font-kerning:
0pt">：</span><b style="mso-bidi-font-weight:normal"><span style="font-size:
12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:
Helvetica;mso-bidi-font-family:Helvetica;color:blue;mso-font-kerning:0pt">声明你生成的类的头文件。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-left:21.0pt;text-align:left;
text-indent:-21.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l6 level1 lfo13"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings;color:blue;mso-font-kerning:0pt"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:red;mso-font-kerning:0pt">addressbook.pb.cc</span><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:&quot;Courier New&quot;;
mso-hansi-font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;mso-font-kerning:
0pt">：</span><b style="mso-bidi-font-weight:normal"><span style="font-size:
12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:
Helvetica;mso-bidi-font-family:Helvetica;color:blue;mso-font-kerning:0pt">你生成的类的实现文件。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p>&nbsp;</o:p></span></b></p>
<div style="mso-element:para-border-div;border:none;border-top:solid #3366CC 1.0pt;
mso-border-top-alt:solid #3366CC .75pt;padding:1.0pt 0cm 0cm 0cm;background:
#E5ECF9;margin-left:-7.5pt;margin-right:0cm"></p>
<p align="left" class="MsoNormal" style="margin-top:24.0pt;text-align:left;
mso-pagination:widow-orphan;mso-outline-level:2;background:#E5ECF9;border:none;
mso-border-top-alt:solid #3366CC .75pt;padding:0cm;mso-padding-alt:1.0pt 0cm 0cm 0cm"><br />
			<b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">The Protocol Buffer API<o:p></o:p></span></b></p>
</p></div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">Let&#39;s look at some of the generated code and see what classes and functions the compiler has created for you. If you look in&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">tutorial.pb.h</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">, you can see that you have a class for each message you specified in&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#007000;mso-font-kerning:0pt">tutorial.proto</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">. Looking closer at the&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">Person</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;class, you can see that the complier has generated accessors for each field. For example, for the&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">name</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">,&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">id</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">,&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">email</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">, and&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">phone</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;fields, you have these methods:<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">让我们看一下生成的代码，了解一下编译器为你创建了什么样的类和函数。如果你看了</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">tutorial.pb.h</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">文件，就会发现你得到了一个类，它对应于</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">tutorial.proto</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">文件中写的每一个消息（</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">message</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">）。更深入一步，看看</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">Person</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">类：编译器为每一个字段生成了读写函数。例如，对</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">name</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">，</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">id</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">，</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">email</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">以及</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">phone</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">字段，分别有如下函数：</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<div style="mso-element:para-border-div;border:solid #BBBBBB 1.0pt;mso-border-alt:
solid #BBBBBB .75pt;padding:12.0pt 12.0pt 12.0pt 12.0pt;background:#FAFAFA"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
			<span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#880000;mso-font-kerning:0pt">// name</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">inline</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#000088;mso-font-kerning:0pt">bool</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> has_name</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">()</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:0pt">const</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">inline</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#000088;mso-font-kerning:0pt">void</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> clear_name</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">();</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">inline</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#000088;mso-font-kerning:0pt">const</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">std</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:0pt">string</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">&amp;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> name</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">()</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:0pt">const</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">inline</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#000088;mso-font-kerning:0pt">void</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> set_name</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">(</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:0pt">const</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">std</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:0pt">string</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">&amp;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> value</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">);</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">inline</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#000088;mso-font-kerning:0pt">void</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> set_name</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">(</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:0pt">const</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:0pt">char</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">*</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> value</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">);</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">inline</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">std</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:0pt">string</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">*</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> mutable_name</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">();</span></p>
<p>			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#880000;
mso-font-kerning:0pt">// id</span><br />
			<span lang="EN-US" style="font-size:9.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">inline</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#000088;mso-font-kerning:0pt">bool</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> has_id</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">()</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:0pt">const</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">inline</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#000088;mso-font-kerning:0pt">void</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> clear_id</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">();</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">inline</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> int32_t id</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">()</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:0pt">const</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">inline</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#000088;mso-font-kerning:0pt">void</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> set_id</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">(</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">int32_t value</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">);</span></p>
<p>			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#880000;
mso-font-kerning:0pt">// email</span><br />
			<span lang="EN-US" style="font-size:9.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">inline</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#000088;mso-font-kerning:0pt">bool</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> has_email</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">()</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:0pt">const</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">inline</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#000088;mso-font-kerning:0pt">void</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> clear_email</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">();</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">inline</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#000088;mso-font-kerning:0pt">const</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">std</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:0pt">string</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">&amp;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> email</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">()</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:0pt">const</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">inline</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#000088;mso-font-kerning:0pt">void</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> set_email</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">(</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:0pt">const</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">std</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:0pt">string</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">&amp;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> value</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">);</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">inline</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#000088;mso-font-kerning:0pt">void</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> set_email</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">(</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:0pt">const</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:0pt">char</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">*</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> value</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">);</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">inline</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">std</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:0pt">string</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">*</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> mutable_email</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">();</span></p>
<p>			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#880000;
mso-font-kerning:0pt">// phone</span><br />
			<span lang="EN-US" style="font-size:9.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">inline</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#000088;mso-font-kerning:0pt">int</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> phone_size</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">()</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:0pt">const</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">inline</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#000088;mso-font-kerning:0pt">void</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> clear_phone</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">();</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">inline</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#000088;mso-font-kerning:0pt">const</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">google</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">protobuf</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#007000;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/reference/cpp/google.protobuf.repeated_field.html#RepeatedPtrField"><span style="mso-bidi-font-size:11.0pt;color:#0000CC">RepeatedPtrField</span></a></span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">&lt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">tutorial</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">Person_PhoneNumber </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">&gt;&amp;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> phone</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">()</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:0pt">const</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">inline</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">google</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">protobuf</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#007000;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/reference/cpp/google.protobuf.repeated_field.html#RepeatedPtrField"><span style="mso-bidi-font-size:11.0pt;color:#0000CC">RepeatedPtrField</span></a></span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">&lt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">tutorial</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">Person_PhoneNumber </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">&gt;*</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> mutable_phone</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">();</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">inline</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#000088;mso-font-kerning:0pt">const</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">tutorial</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">Person_PhoneNumber</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">&amp;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> phone</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">(</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:0pt">int</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> index</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">)</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:0pt">const</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">inline</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">tutorial</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">Person_PhoneNumber</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">*</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> mutable_phone</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">(</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:0pt">int</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> index</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">);</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">inline</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">tutorial</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">Person_PhoneNumber</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">*</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> add_phone</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">();</span><span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#007000;mso-font-kerning:0pt"><o:p></o:p></span></p>
</p></div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">As you can see, the getters have exactly the name as the field in lowercase, and the setter methods begin with&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#007000;mso-font-kerning:0pt">set_</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">. There are also&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">has_</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;methods for each singular (required or optional) field which return true if that field has been set. Finally, each field has a&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#007000;
mso-font-kerning:0pt">clear_</span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">&nbsp;method that un-sets the field back to its empty state.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">正如你所看到的，</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">getter</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">函数具有与字段名一模一样的名字，并且是小写的，而</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">setter</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">函数都是以</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">set_</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">前缀开头。此外，还有</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">has_</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">前缀的函数，对每一个单一的（</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">required</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">或</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">optional</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">的）字段（译者注：此处估计是&ldquo;非</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:red;mso-font-kerning:0pt">repeated</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">字段&rdquo;的意思）来说，如果字段被置（</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">set</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">）了值，该函数会返回</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">true</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">。最后，每一个字段还有一个</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">clear_</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">前缀的函数，用来将字段重置（</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">un-set</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">）到空状态（</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">empty state</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:
12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:
Helvetica;mso-bidi-font-family:Helvetica;color:blue;mso-font-kerning:0pt">）。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span style="color: rgb(255, 255, 255); font-family: arial, helvetica, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="line-height: 15pt; font-size: 12pt; font-family: Helvetica, sans-serif; ">While the numeric&nbsp;</span><span lang="EN-US" style="line-height: 15pt; font-size: 10pt; font-family: 'Courier New'; color: rgb(0, 112, 0); ">id</span><span lang="EN-US" style="line-height: 15pt; font-size: 12pt; font-family: Helvetica, sans-serif; ">&nbsp;field just has the basic accessor set described above, the&nbsp;</span><span lang="EN-US" style="line-height: 15pt; font-size: 10pt; font-family: 'Courier New'; color: rgb(0, 112, 0); ">name</span><span lang="EN-US" style="line-height: 15pt; font-size: 12pt; font-family: Helvetica, sans-serif; ">&nbsp;and&nbsp;</span><span lang="EN-US" style="line-height: 15pt; font-size: 10pt; font-family: 'Courier New'; color: rgb(0, 112, 0); ">email</span><span lang="EN-US" style="line-height: 15pt; font-size: 12pt; font-family: Helvetica, sans-serif; ">&nbsp;fields have a couple of extra methods because they&#39;re strings &ndash; a&nbsp;</span><span lang="EN-US" style="line-height: 15pt; font-size: 10pt; font-family: 'Courier New'; color: rgb(0, 112, 0); ">mutable_</span><span lang="EN-US" style="line-height: 15pt; font-size: 12pt; font-family: Helvetica, sans-serif; ">&nbsp;getter that lets you get a direct pointer to the string, and an extra setter. Note that you can call&nbsp;</span><span lang="EN-US" style="line-height: 15pt; font-size: 10pt; font-family: 'Courier New'; color: rgb(0, 112, 0); ">mutable_email()</span><span lang="EN-US" style="line-height: 15pt; font-size: 12pt; font-family: Helvetica, sans-serif; ">&nbsp;even if</span><span lang="EN-US" style="line-height: 15pt; font-size: 10pt; font-family: 'Courier New'; color: rgb(0, 112, 0); ">email</span><span lang="EN-US" style="line-height: 15pt; font-size: 12pt; font-family: Helvetica, sans-serif; ">&nbsp;is not already set; it will be initialized to an empty string automatically. If you had a singular message field in this example, it would also have a&nbsp;</span><span lang="EN-US" style="line-height: 15pt; font-size: 10pt; font-family: 'Courier New'; color: rgb(0, 112, 0); ">mutable_</span><span lang="EN-US" style="line-height: 15pt; font-size: 12pt; font-family: Helvetica, sans-serif; ">&nbsp;method but not a&nbsp;</span><span lang="EN-US" style="line-height: 15pt; font-size: 10pt; font-family: 'Courier New'; color: rgb(0, 112, 0); ">set_</span><span lang="EN-US" style="line-height: 15pt; font-size: 12pt; font-family: Helvetica, sans-serif; ">&nbsp;method.</span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">然而，数值类型的字段</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">id</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">就只有如上所述的基本读写函数，</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">name</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">和</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">email</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">字段则有一些额外的函数，因为它们是</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">string</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">&mdash;&mdash;前缀为</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">mutable_</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">的函数返回</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">string</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">的直接指针（</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">direct pointer</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">）。除此之外，还有一个额外的</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">setter</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">函数。注意：你甚至可以在</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">email</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">还没有被置（</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">set</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">）值的时候就调用</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">mutable_email()</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">，它会被自动初始化为一个空字符串。在此例中，如果有一个单一消息字段，那么它也会有一个</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">mutable_</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">前缀的函数，但是没有一个</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">set_</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">前缀的函数。</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p>&nbsp;</o:p></span></b><span lang="EN-US" style="line-height: 15pt; font-size: 12pt; font-family: Helvetica, sans-serif; ">Repeated fields also have some special methods &ndash; if you look at the methods for the repeated&nbsp;</span><span lang="EN-US" style="line-height: 15pt; font-size: 10pt; font-family: 'Courier New'; color: rgb(0, 112, 0); ">phone</span><span lang="EN-US" style="line-height: 15pt; font-size: 12pt; font-family: Helvetica, sans-serif; ">&nbsp;field, you&#39;ll see that you can</span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l1 level1 lfo6;tab-stops:list 36.0pt"><br />
		<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">check the repeated field&#39;s&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#007000;mso-font-kerning:0pt">_size</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;(in other words, how many phone numbers are associated with this&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#007000;mso-font-kerning:0pt">Person</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">).<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l1 level1 lfo6;tab-stops:list 36.0pt"><br />
		<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">get a specified phone number using its index.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l1 level1 lfo6;tab-stops:list 36.0pt"><br />
		<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">update an existing phone number at the specified index.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l1 level1 lfo6;tab-stops:list 36.0pt"><br />
		<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">add another phone number to the message which you can then edit (repeated scalar types have an&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#007000;
mso-font-kerning:0pt">add_</span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">&nbsp;that just lets you pass in the new value).<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">重复的字段也有一些特殊的函数&mdash;&mdash;如果你看一下重复字段</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">phone</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">的那些函数，就会发现你可以：</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-left:21.0pt;text-align:left;
text-indent:-21.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l9 level1 lfo14"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings;color:blue;mso-font-kerning:0pt"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">得到重复字段的</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">_size</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">（换句话说，这个</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">Person</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">关联了多少个电话号码）。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-left:21.0pt;text-align:left;
text-indent:-21.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l9 level1 lfo14"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings;color:blue;mso-font-kerning:0pt"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">通过索引（</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">index</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">）来获取一个指定的电话号码。</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-left:21.0pt;text-align:left;
text-indent:-21.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l9 level1 lfo14"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings;color:blue;mso-font-kerning:0pt"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">通过指定的索引（</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">index</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">）来更新一个已经存在的电话号码。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-left:21.0pt;text-align:left;
text-indent:-21.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l9 level1 lfo14"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings;color:blue;mso-font-kerning:0pt"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">向消息（</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">message</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">）中添加另一个电话号码，然后你可以编辑它（重复的标量类型有一个</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">add_</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">前缀的函数，允许你传新值进去）。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;text-align:left;
line-height:15.0pt;mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt"><o:p>&nbsp;</o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">For more information on exactly what members the protocol compiler generates for any particular field definition, see the&nbsp;<a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/reference/cpp-generated.html"><span style="color:#0000CC">C++ generated code reference</span></a>.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">关于编译器如何生成特殊字段的更多信息，请查看文章</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/reference/cpp-generated.html"><span style="color:#0000CC">C++ generated code reference</span></a></span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">。</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-top:18.0pt;text-align:left;
mso-pagination:widow-orphan;mso-outline-level:3"><br />
		<b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">Enums and Nested Classes </span></b><b><span style="font-size:15.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">枚举和嵌套类</span></b><b><span lang="EN-US" style="font-size:
15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">The generated code includes a&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#007000;mso-font-kerning:0pt">PhoneType</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;enum that corresponds to your&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">.proto</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;enum. You can refer to this type as&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#007000;
mso-font-kerning:0pt">Person::PhoneType</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;and its values as&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">Person::MOBILE</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">,&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">Person::HOME</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">, and&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">Person::WORK</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;(the implementation details are a little more complicated, but you don&#39;t need to understand them to use the enum).<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">生成的代码中包含了一个</span></b><span lang="EN-US" style="font-size:
10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#007000;mso-font-kerning:0pt">PhoneType</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">枚举，它对应于</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">.proto</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">文件中的那个枚举。你可以把这个类型当作</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">Person::PhoneType</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">，其值为</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">Person::MOBILE</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">，</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">Person::HOME</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">和</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">Person::WORK</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">（实现的细节稍微复杂了点，但是没关系，不理解它也不会影响你使用该枚举）。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><o:p>&nbsp;</o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">The compiler has also generated a nested class for you called&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">Person::PhoneNumber</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">. If you look at the code, you can see that the &quot;real&quot; class is actually called&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">Person_PhoneNumber</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">, but a typedef defined inside&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">Person</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;allows you to treat it as if it were a nested class. The only case where this makes a difference is if you want to forward-declare the class in another file &ndash; you cannot forward-declare nested types in C++, but you can forward-declare&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">Person_PhoneNumber</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">编译器还生成了一个名为</span></b><span lang="EN-US" style="font-size:
10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#007000;mso-font-kerning:0pt">Person::PhoneNumber</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">的嵌套类。如果你看看代码，就会发现&ldquo;真实的&rdquo;类实际上是叫做</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">Person_PhoneNumber</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">，只不过</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">Person</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">内部的一个</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">typedef</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">允许你像一个嵌套类一样来对待它。这一点所造成的唯一一个区别就是：如果你想在另一个文件中对类进行前向声明（</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">forward-declare</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">）的话，你就不能在</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">C++</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">中对嵌套类型进行前向声明了，但是你可以对</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">Person_PhoneNumber</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">进行前向声明。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-top:18.0pt;text-align:left;
mso-pagination:widow-orphan;mso-outline-level:3"><br />
		<b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">Standard Message Methods </span></b><b><span style="font-size:15.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">标准消息函数</span></b><b><span lang="EN-US" style="font-size:
15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">Each message class also contains a number of other methods that let you check or manipulate the entire message, including:<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l10 level1 lfo7;tab-stops:list 36.0pt"><br />
		<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#007000;mso-font-kerning:0pt">bool IsInitialized() const;</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">: checks if all the required fields have been set.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l10 level1 lfo7;tab-stops:list 36.0pt"><br />
		<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#007000;mso-font-kerning:0pt">string DebugString() const;</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">: returns a human-readable representation of the message, particularly useful for debugging.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l10 level1 lfo7;tab-stops:list 36.0pt"><br />
		<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#007000;mso-font-kerning:0pt">void CopyFrom(const Person&amp; from);</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">: overwrites the message with the given message&#39;s values.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l10 level1 lfo7;tab-stops:list 36.0pt"><br />
		<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#007000;mso-font-kerning:0pt">void Clear();</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">: clears all the elements back to the empty state.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">These and the I/O methods described in the following section implement the&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">Message</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;interface shared by all C++ protocol buffer classes. For more info, see the&nbsp;<a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/reference/cpp/google.protobuf.message.html#Message"><span style="color:#0000CC">complete API documentation for&nbsp;</span><span style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000">Message</span></a>.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">每一个消息（</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">message</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">）还包含了其他一系列函数，用来检查或管理整个消息，包括：</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-left:21.0pt;text-align:left;
text-indent:-21.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l9 level1 lfo14"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings;color:blue;mso-font-kerning:0pt"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">bool IsInitialized() const;</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">：检查是否全部的</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">required</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">字段都被置（</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">set</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">）了值。</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-left:21.0pt;text-align:left;
text-indent:-21.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l9 level1 lfo14"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings;color:blue;mso-font-kerning:0pt"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">string DebugString() const;</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">：返回一个易读的消息表示形式，对调试特别有用。</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-left:21.0pt;text-align:left;
text-indent:-21.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l9 level1 lfo14"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings;color:blue;mso-font-kerning:0pt"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">void CopyFrom(const Person&amp; from);</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">：用外部消息的值，覆写调用者消息内部的值。</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-left:21.0pt;text-align:left;
text-indent:-21.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l9 level1 lfo14"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings;color:blue;mso-font-kerning:0pt"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">void Clear();</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">：将所有项复位到空状态（</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">empty state</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:
12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:
Helvetica;mso-bidi-font-family:Helvetica;color:blue;mso-font-kerning:0pt">）。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">这些函数以及后面章节将要提到的</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">I/O</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">函数实现了</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">Message</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">的接口，它们被所有</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">C++ protocol buffer</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">类共享。更多信息，请查看文章</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;<a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/reference/cpp/google.protobuf.message.html#Message"><span style="color:#0000CC">complete API documentation for&nbsp;</span><span style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000">Message</span></a></span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">。</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><o:p>&nbsp;</o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:18.0pt;text-align:left;
mso-pagination:widow-orphan;mso-outline-level:3"><br />
		<b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">Parsing and Serialization </span></b><b><span style="font-size:15.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">解析</span></b><b><span lang="EN-US" style="font-size:15.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">&amp;</span></b><b><span style="font-size:15.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">序列化</span></b><b><span lang="EN-US" style="font-size:15.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">Finally, each protocol buffer class has methods for writing and reading messages of your chosen type using the protocol buffer&nbsp;<a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/encoding.html"><span style="color:#0000CC">binary format</span></a>. These include:<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l7 level1 lfo8;tab-stops:list 36.0pt"><br />
		<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#007000;mso-font-kerning:0pt">bool SerializeToString(string* output) const;</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">: serializes the message and stores the bytes in the given string. Note that the bytes are binary, not text; we only use the&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#007000;
mso-font-kerning:0pt">string</span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">&nbsp;class as a convenient container.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l7 level1 lfo8;tab-stops:list 36.0pt"><br />
		<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#007000;mso-font-kerning:0pt">bool ParseFromString(const string&amp; data);</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">: parses a message from the given string.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l7 level1 lfo8;tab-stops:list 36.0pt"><br />
		<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#007000;mso-font-kerning:0pt">bool SerializeToOstream(ostream* output) const;</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">: writes the message to the given C++&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">ostream</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l7 level1 lfo8;tab-stops:list 36.0pt"><br />
		<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#007000;mso-font-kerning:0pt">bool ParseFromIstream(istream* input);</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">: parses a message from the given C++&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">istream</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">These are just a couple of the options provided for parsing and serialization. Again, see the&nbsp;<a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/reference/cpp/google.protobuf.message.html#Message"><span style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000">Message</span><span style="color:#0000CC">&nbsp;API reference</span></a>&nbsp;for a complete list.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">最后，每一个</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">protocol buffer</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">类都有读写你所选择的消息类型的函数。它们包括：</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-left:21.0pt;text-align:left;
text-indent:-21.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l14 level1 lfo17"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings;color:blue;mso-font-kerning:0pt"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">bool SerializeToString(string* output) const;</span><span style="font-size:12.0pt;
font-family:宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;
mso-bidi-font-family:Helvetica;color:black;mso-font-kerning:0pt">：</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">将消息序列化并储存在指定的</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">string</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">中。注意里面的内容是二进制的，而不是文本；我们只是使用</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">string</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">作为一个很方便的容器。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-left:21.0pt;text-align:left;
text-indent:-21.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l14 level1 lfo17"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings;color:blue;mso-font-kerning:0pt"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">bool ParseFromString(const string&amp; data);</span><span style="font-size:12.0pt;
font-family:宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;
mso-bidi-font-family:Helvetica;color:black;mso-font-kerning:0pt">：</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">从给定的</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">string</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">解析消息。</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-left:21.0pt;text-align:left;
text-indent:-21.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l14 level1 lfo17"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings;color:blue;mso-font-kerning:0pt"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">bool SerializeToOstream(ostream* output) const;</span><span style="font-size:12.0pt;
font-family:宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;
mso-bidi-font-family:Helvetica;color:black;mso-font-kerning:0pt">：</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">将消息写入到给定的</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">C++ </span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">ostream</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">中。</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-left:21.0pt;text-align:left;
text-indent:-21.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l14 level1 lfo17"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings;color:blue;mso-font-kerning:0pt"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">bool ParseFromIstream(istream* input);</span><span style="font-size:12.0pt;
font-family:宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;
mso-bidi-font-family:Helvetica;color:black;mso-font-kerning:0pt">：</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">从给定的</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">C++ </span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">istream</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">解析消息。</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">这些函数只是用于解析和序列化的几个函数罢了。请再次参考</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/reference/cpp/google.protobuf.message.html#Message"><span style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000">Message</span><span style="color:#0000CC">&nbsp;API reference</span></a></span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">以查看完整的函数列表。</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p>&nbsp;</o:p></span></b></p>
<div style="mso-element:para-border-div;border-top:solid #FFCC33 1.0pt;
border-left:none;border-bottom:solid #FFCC33 1.0pt;border-right:none;
mso-border-top-alt:solid #FFCC33 .75pt;mso-border-bottom-alt:solid #FFCC33 .75pt;
padding:2.0pt 0cm 2.0pt 0cm;background:#EFEFEF"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:15.0pt;mso-pagination:widow-orphan;background:#EFEFEF;border:none;
mso-border-top-alt:solid #FFCC33 .75pt;mso-border-bottom-alt:solid #FFCC33 .75pt;
padding:0cm;mso-padding-alt:2.0pt 0cm 2.0pt 0cm"><br />
			<b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">Protocol Buffers and O-O Design</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;Protocol buffer classes are basically dumb data holders (like structs in C++); they don&#39;t make good first class citizens in an object model. If you want to add richer behaviour to a generated class, the best way to do this is to wrap the generated protocol buffer class in an application-specific class. Wrapping protocol buffers is also a good idea if you don&#39;t have control over the design of the&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">.proto</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;file (if, say, you&#39;re reusing one from another project). In that case, you can use the wrapper class to craft an interface better suited to the unique environment of your application: hiding some data and methods, exposing convenience functions, etc.&nbsp;<b>You should never add behaviour to the generated classes by inheriting from them</b>. This will break internal mechanisms and is not good object-oriented practice anyway.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:15.0pt;mso-pagination:widow-orphan;background:#EFEFEF;border:none;
mso-border-top-alt:solid #FFCC33 .75pt;mso-border-bottom-alt:solid #FFCC33 .75pt;
padding:0cm;mso-padding-alt:2.0pt 0cm 2.0pt 0cm"><br />
			<b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:red;mso-font-kerning:0pt">protocol buffers</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:red;mso-font-kerning:0pt">和面向对象的设计</span></b><span style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"> </span><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">protocol buffer</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:
12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:
Helvetica;mso-bidi-font-family:Helvetica;color:blue;mso-font-kerning:0pt">类通常只是纯粹的数据存储器（就像</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">C++</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">中的结构体一样）；它们在对象模型中并不是一等公民。如果你想向生成的类中添加更丰富的行为，最好的方法就是在应用程序中对它进行封装。如果你无权控制</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">.proto</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">文件的设计的话，封装</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">protocol buffers</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">也是一个好主意（例如，你从另一个项目中重用一个</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">.proto</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">文件）。在那种情况下，你可以用封装类来设计接口，以更好地适应你的应用程序的特定环境：隐藏一些数据和方法，暴露一些便于使用的函数，等等。</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:#7030A0;mso-font-kerning:0pt">但是你绝对不要通过继承生成的类来添加行为</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">。这样做的话，会破坏其内部机制，并且不是一个好的面向对象的实践。</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt"><o:p></o:p></span></p>
</p></div>
<div style="mso-element:para-border-div;border:none;border-top:solid #3366CC 1.0pt;
mso-border-top-alt:solid #3366CC .75pt;padding:1.0pt 0cm 0cm 0cm;background:
#E5ECF9;margin-left:-7.5pt;margin-right:0cm"></p>
<p align="left" class="MsoNormal" style="margin-top:24.0pt;text-align:left;
mso-pagination:widow-orphan;mso-outline-level:2;background:#E5ECF9;border:none;
mso-border-top-alt:solid #3366CC .75pt;padding:0cm;mso-padding-alt:1.0pt 0cm 0cm 0cm"><br />
			<b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">Writing A Message </span></b><b><span style="font-size:15.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">写消息</span></b><b><span lang="EN-US" style="font-size:15.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
</p></div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">Now let&#39;s try using your protocol buffer classes. The first thing you want your address book application to be able to do is write personal details to your address book file. To do this, you need to create and populate instances of your protocol buffer classes and then write them to an output stream.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">Here is a program which reads an&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#007000;mso-font-kerning:0pt">AddressBook</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;from a file, adds one new&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">Person</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;to it based on user input, and writes the new&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#007000;
mso-font-kerning:0pt">AddressBook</span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">&nbsp;back out to the file again. The parts which directly call or reference code generated by the protocol compiler are highlighted.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">现在让我们尝试使用你的</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">protocol buffer</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">类。你想让你的</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">address book</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">程序完成的第一件事情就是向你的</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">address book</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">文件写入详细的个人信息。要实现这一点，你需要创建</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">protocol buffer</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:
12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:
Helvetica;mso-bidi-font-family:Helvetica;color:blue;mso-font-kerning:0pt">类的实例并将它们写入到一个输出流（</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">output stream</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:
12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:
Helvetica;mso-bidi-font-family:Helvetica;color:blue;mso-font-kerning:0pt">）中。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">下面的这个程序从一个文件中读取</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">AddressBook</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">，然后根据用户的输入向其中添加一个新的</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">Person</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">，然后再将新的</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">AddressBook</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">&nbsp;</span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">写回文件中。由</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">protocol buffer</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">编译器生成的代码或者直接调用的代码都被突出显示了。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<div style="mso-element:para-border-div;border:solid #BBBBBB 1.0pt;mso-border-alt:
solid #BBBBBB .75pt;padding:12.0pt 12.0pt 12.0pt 12.0pt;background:#FAFAFA"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
			<span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#880000;mso-font-kerning:0pt">#include</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#008800;mso-font-kerning:0pt">&lt;iostream&gt;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#880000;mso-font-kerning:
0pt">#include</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;
mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#008800;mso-font-kerning:0pt">&lt;fstream&gt;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#880000;mso-font-kerning:
0pt">#include</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;
mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#008800;mso-font-kerning:0pt">&lt;string&gt;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#880000;mso-font-kerning:
0pt">#include</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;
mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#008800;mso-font-kerning:0pt">&quot;addressbook.pb.h&quot;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:
0pt">using</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;
mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#000088;mso-font-kerning:0pt">namespace</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> std</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span></p>
<p>			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#880000;mso-font-kerning:
0pt">// This function fills in a Person message based on user input.</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:
0pt">void</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;
mso-font-kerning:0pt"> PromptForAddress</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">(</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">tutorial</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">Person</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">*</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> person</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">)</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">{</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; cout </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;
mso-font-kerning:0pt">&lt;&lt;</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#008800;mso-font-kerning:0pt">&quot;Enter person ID number: &quot;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">int</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> id</span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#666600;mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; cin </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;
mso-font-kerning:0pt">&gt;&gt;</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> id</span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#666600;mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; person</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;
mso-font-kerning:0pt">-&gt;</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt">set_id</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">(</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">id</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">);</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; cin</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;
mso-font-kerning:0pt">.</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt">ignore</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">(</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#006666;mso-font-kerning:0pt">256</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">,</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#008800;mso-font-kerning:0pt">&#39;\n&#39;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">);<span style="mso-tab-count:1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#009900;mso-font-kerning:0pt">//</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:red;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#009900;mso-font-kerning:0pt">cin.ignore(a,ch)</span><span style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Courier New&quot;;mso-hansi-font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#009900;mso-font-kerning:0pt">方法是从输入流（</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#009900;mso-font-kerning:0pt">cin</span><span style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Courier New&quot;;mso-hansi-font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#009900;mso-font-kerning:0pt">）中提取字符，提取的字符被忽略（</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#009900;mso-font-kerning:0pt">ignore</span><span style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Courier New&quot;;mso-hansi-font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#009900;mso-font-kerning:0pt">），不被使用。每抛弃一个字符，它都要计数和比较字符：如果计数值达到</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#009900;mso-font-kerning:0pt">a</span><span style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Courier New&quot;;mso-hansi-font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#009900;mso-font-kerning:0pt">或者被抛弃的字符是</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#009900;mso-font-kerning:0pt">ch</span><span style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Courier New&quot;;mso-hansi-font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#009900;mso-font-kerning:0pt">，则</span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#009900;mso-font-kerning:0pt">cin.ignore()</span><span style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Courier New&quot;;mso-hansi-font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#009900;mso-font-kerning:0pt">函数执行终止；否则，它继续等待。它的一个常用功能就是用来清除以回车结束的输入缓冲区的内容，消除上一次输入对下一次输入的影响。比如可以这么用：</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#009900;mso-font-kerning:0pt">cin.ignore(1024,&#39;\n&#39;)</span><span style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Courier New&quot;;mso-hansi-font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#009900;mso-font-kerning:0pt">，通常把第一个参数设置得足够大，这样实际上总是只有第二个参数</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#009900;mso-font-kerning:0pt">&#39;\n&#39;</span><span style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Courier New&quot;;mso-hansi-font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#009900;mso-font-kerning:0pt">起作用，所以这一句就是把回车（包括回车）之前的所以字符从输入缓冲（流）中清除出去。</span></p>
<p>			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; cout </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;
mso-font-kerning:0pt">&lt;&lt;</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#008800;mso-font-kerning:0pt">&quot;Enter name: &quot;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; getline</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;
mso-font-kerning:0pt">(</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt">cin</span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#666600;mso-font-kerning:0pt">,</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">*</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">person</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">-&gt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">mutable_name</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">());</span></p>
<p>			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; cout </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;
mso-font-kerning:0pt">&lt;&lt;</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#008800;mso-font-kerning:0pt">&quot;Enter email address (blank for none): &quot;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;
mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">string</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> email</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; getline</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;
mso-font-kerning:0pt">(</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt">cin</span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#666600;mso-font-kerning:0pt">,</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> email</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">);</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">if</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#666600;mso-font-kerning:0pt">(!</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">email</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">.</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">empty</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">())</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">{</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; person</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#666600;mso-font-kerning:0pt">-&gt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">set_email</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">(</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">email</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">);</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;
mso-font-kerning:0pt">}</span></p>
<p>			<span lang="EN-US" style="font-size:9.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">while</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#666600;mso-font-kerning:0pt">(</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:0pt">true</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">)</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">{</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; cout </span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#666600;mso-font-kerning:0pt">&lt;&lt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#008800;mso-font-kerning:0pt">&quot;Enter a phone number (or leave blank to finish): &quot;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">string</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> number</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; getline</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#666600;mso-font-kerning:0pt">(</span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt">cin</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">,</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> number</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">);</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">if</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#666600;mso-font-kerning:0pt">(</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">number</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">.</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">empty</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">())</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">{</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; &nbsp; </span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#000088;mso-font-kerning:0pt">break</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;
mso-font-kerning:0pt">}</span></p>
<p>			<span lang="EN-US" style="font-size:9.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; tutorial</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt">Person</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">PhoneNumber</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">*</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> phone_number </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">=</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> person</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">-&gt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">add_phone</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">();</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; phone_number</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#666600;mso-font-kerning:0pt">-&gt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">set_number</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">(</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">number</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">);</span></p>
<p>			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; cout </span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#666600;mso-font-kerning:0pt">&lt;&lt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#008800;mso-font-kerning:0pt">&quot;Is this a mobile, home, or work phone? &quot;</span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#666600;mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">string</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> type</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; getline</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#666600;mso-font-kerning:0pt">(</span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt">cin</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">,</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> type</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">);</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">if</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#666600;mso-font-kerning:0pt">(</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">type </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">==</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#008800;mso-font-kerning:0pt">&quot;mobile&quot;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">)</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">{</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; &nbsp; phone_number</span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#666600;mso-font-kerning:0pt">-&gt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">set_type</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">(</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">tutorial</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">Person</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">MOBILE</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">);</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;
mso-font-kerning:0pt">}</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#000088;mso-font-kerning:0pt">else</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:0pt">if</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">(</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">type </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">==</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#008800;mso-font-kerning:0pt">&quot;home&quot;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">)</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">{</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; &nbsp; phone_number</span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#666600;mso-font-kerning:0pt">-&gt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">set_type</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">(</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">tutorial</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">Person</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">HOME</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">);</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;
mso-font-kerning:0pt">}</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#000088;mso-font-kerning:0pt">else</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:0pt">if</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">(</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">type </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">==</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#008800;mso-font-kerning:0pt">&quot;work&quot;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">)</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">{</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; &nbsp; phone_number</span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#666600;mso-font-kerning:0pt">-&gt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">set_type</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">(</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">tutorial</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">Person</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">WORK</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">);</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;
mso-font-kerning:0pt">}</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#000088;mso-font-kerning:0pt">else</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">{</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; &nbsp; cout </span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#666600;mso-font-kerning:0pt">&lt;&lt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#008800;mso-font-kerning:0pt">&quot;Unknown phone type. &nbsp;Using default.&quot;</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#666600;mso-font-kerning:0pt">&lt;&lt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> endl</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;
mso-font-kerning:0pt">}</span><br />
			<span lang="EN-US" style="font-size:9.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;
mso-font-kerning:0pt">}</span><br />
			<span lang="EN-US" style="font-size:9.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:
0pt">}</span></p>
<p>			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#880000;mso-font-kerning:
0pt">// Main function: &nbsp;Reads the entire address book from a file,</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#880000;mso-font-kerning:
0pt">// &nbsp; adds one person based on user input, then writes it back out to the same</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#880000;mso-font-kerning:
0pt">// &nbsp; file.</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:
&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:
0pt">int</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt"> main</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;
mso-font-kerning:0pt">(</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#000088;mso-font-kerning:0pt">int</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> argc</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">,</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:0pt">char</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">*</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> argv</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">[])</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">{</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#880000;
mso-font-kerning:0pt">// Verify that the version of the library that we linked against is</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#880000;
mso-font-kerning:0pt">// compatible with the version of the headers we compiled against.</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; GOOGLE_PROTOBUF_VERIFY_VERSION</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span></p>
<p>			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">if</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#666600;mso-font-kerning:0pt">(</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">argc </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">!=</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#006666;mso-font-kerning:0pt">2</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">)</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">{</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; cerr </span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#666600;mso-font-kerning:0pt">&lt;&lt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#008800;mso-font-kerning:0pt">&quot;Usage: &nbsp;&quot;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;
mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#666600;mso-font-kerning:0pt">&lt;&lt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> argv</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">[</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#006666;mso-font-kerning:0pt">0</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">]</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">&lt;&lt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#008800;mso-font-kerning:0pt">&quot; ADDRESS_BOOK_FILE&quot;</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#666600;mso-font-kerning:0pt">&lt;&lt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> endl</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">return</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#666600;mso-font-kerning:0pt">-</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#006666;mso-font-kerning:0pt">1</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;
mso-font-kerning:0pt">}</span></p>
<p>			<span lang="EN-US" style="font-size:9.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; tutorial</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;
mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt">AddressBook address_book</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span></p>
<p>			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;
mso-font-kerning:0pt">{</span><br />
			<span lang="EN-US" style="font-size:9.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#880000;
mso-font-kerning:0pt">// Read the existing address book.</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; fstream input</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#666600;mso-font-kerning:0pt">(</span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt">argv</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">[</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#006666;mso-font-kerning:0pt">1</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">],</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> ios</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:0pt">in</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">|</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> ios</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">binary</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">);</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">if</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#666600;mso-font-kerning:0pt">(!</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">input</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">)</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">{</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; &nbsp; cout </span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#666600;mso-font-kerning:0pt">&lt;&lt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> argv</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">[</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#006666;mso-font-kerning:0pt">1</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">]</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">&lt;&lt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#008800;mso-font-kerning:0pt">&quot;: File not found. &nbsp;Creating a new file.&quot;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">&lt;&lt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> endl</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;
mso-font-kerning:0pt">}</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#000088;mso-font-kerning:0pt">else</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:0pt">if</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">(!</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">address_book</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">.</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">ParseFromIstream</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">(&amp;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">input</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">))</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">{</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; &nbsp; cerr </span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#666600;mso-font-kerning:0pt">&lt;&lt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#008800;mso-font-kerning:0pt">&quot;Failed to parse address book.&quot;</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#666600;mso-font-kerning:0pt">&lt;&lt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> endl</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; &nbsp; </span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#000088;mso-font-kerning:0pt">return</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">-</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#006666;mso-font-kerning:0pt">1</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;
mso-font-kerning:0pt">}</span><br />
			<span lang="EN-US" style="font-size:9.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;
mso-font-kerning:0pt">}</span></p>
<p>			<span lang="EN-US" style="font-size:9.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#880000;
mso-font-kerning:0pt">// Add an address.</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; PromptForAddress</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#666600;mso-font-kerning:0pt">(</span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt">address_book</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">.</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">add_person</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">());</span></p>
<p>			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;
mso-font-kerning:0pt">{</span><br />
			<span lang="EN-US" style="font-size:9.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#880000;
mso-font-kerning:0pt">// Write the new address book back to disk.</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; fstream output</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#666600;mso-font-kerning:0pt">(</span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt">argv</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">[</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#006666;mso-font-kerning:0pt">1</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">],</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> ios</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:0pt">out</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">|</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> ios</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">trunc </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">|</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> ios</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">binary</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">);</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">if</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#666600;mso-font-kerning:0pt">(!</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">address_book</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">.</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">SerializeToOstream</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">(&amp;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">output</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">))</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">{</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; &nbsp; cerr </span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#666600;mso-font-kerning:0pt">&lt;&lt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#008800;mso-font-kerning:0pt">&quot;Failed to write address book.&quot;</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#666600;mso-font-kerning:0pt">&lt;&lt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> endl</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; &nbsp; </span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#000088;mso-font-kerning:0pt">return</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">-</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#006666;mso-font-kerning:0pt">1</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;
mso-font-kerning:0pt">}</span><br />
			<span lang="EN-US" style="font-size:9.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;
mso-font-kerning:0pt">}</span></p>
<p>			<span lang="EN-US" style="font-size:9.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#880000;
mso-font-kerning:0pt">// Optional: &nbsp;Delete all global objects allocated by libprotobuf.</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; google</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;
mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt">protobuf</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">ShutdownProtobufLibrary</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">();</span></p>
<p>			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">return</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#006666;mso-font-kerning:0pt">0</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:
0pt">}</span><span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt"><o:p></o:p></span></p>
</p></div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">Notice the&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#007000;
mso-font-kerning:0pt">GOOGLE_PROTOBUF_VERIFY_VERSION</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;macro. It is good practice &ndash; though not strictly necessary &ndash; to execute this macro before using the C++ Protocol Buffer library. It verifies that you have not accidentally linked against a version of the library which is incompatible with the version of the headers you compiled with. If a version mismatch is detected, the program will abort. Note that every&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#007000;
mso-font-kerning:0pt">.pb.cc</span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">&nbsp;file automatically invokes this macro on startup.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">注意</span></b><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#007000;mso-font-kerning:0pt">GOOGLE_PROTOBUF_VERIFY_VERSION</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">宏。你最好像这样&mdash;&mdash;尽管这不是严格要求的&mdash;&mdash;在使用</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">C++ Protocol Buffer</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">库之前执行该宏。它会检查你是不是在无意中链接到了与你使用的头文件不兼容的</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">protocol buffer</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:
12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:
Helvetica;mso-bidi-font-family:Helvetica;color:blue;mso-font-kerning:0pt">库。如果检测到了不匹配情况，程序会中止运行下去。注意：每一个</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">.pb.cc</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">文件在开始的时候都会自动调用该宏。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span style="color: rgb(255, 255, 255); font-family: arial, helvetica, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="line-height: 15pt; font-size: 12pt; font-family: Helvetica, sans-serif; ">Also notice the call to&nbsp;</span><span lang="EN-US" style="line-height: 15pt; font-size: 10pt; font-family: 'Courier New'; color: rgb(0, 112, 0); ">ShutdownProtobufLibrary()</span><span lang="EN-US" style="line-height: 15pt; font-size: 12pt; font-family: Helvetica, sans-serif; ">&nbsp;at the end of the program. All this does is delete any global objects that were allocated by the Protocol Buffer library. This is unnecessary for most programs, since the process is just going to exit anyway and the OS will take care of reclaiming all of its memory. However, if you use a memory leak checker that requires that every last object be freed, or if you are writing a library which may be loaded and unloaded multiple times by a single process, then you may want to force Protocol Buffers to clean up everything.</span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">另外还需要注意的是程序结尾处调用的</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">ShutdownProtobufLibrary()</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">函数。该函数所做的所有工作就是删除由</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">Protocol Buffer</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:
12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:
Helvetica;mso-bidi-font-family:Helvetica;color:blue;mso-font-kerning:0pt">库分配的全局对象。在大多数程序中，这都是没有必要的，因为进程一退出，操作系统就回收了它的内存。然而，如果你使用了内存检查工具（译者注：例如</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">valgrind</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">）来检查你的程序的话（内存检查工具要求每一个对象最后都要被释放），或者你写了一个可能会在一个进程中多次被加载、卸载的库，那么你可能就需要强制</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">Protocol Buffer</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:
12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:
Helvetica;mso-bidi-font-family:Helvetica;color:blue;mso-font-kerning:0pt">来清理一切了。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<div style="mso-element:para-border-div;border:none;border-top:solid #3366CC 1.0pt;
mso-border-top-alt:solid #3366CC .75pt;padding:1.0pt 0cm 0cm 0cm;background:
#E5ECF9;margin-left:-7.5pt;margin-right:0cm"></p>
<p align="left" class="MsoNormal" style="margin-top:24.0pt;text-align:left;
mso-pagination:widow-orphan;mso-outline-level:2;background:#E5ECF9;border:none;
mso-border-top-alt:solid #3366CC .75pt;padding:0cm;mso-padding-alt:1.0pt 0cm 0cm 0cm"><br />
			<b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">Reading A Message </span></b><b><span style="font-size:15.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">读消息</span></b><b><span lang="EN-US" style="font-size:15.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
</p></div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">Of course, an address book wouldn&#39;t be much use if you couldn&#39;t get any information out of it! This example reads the file created by the above example and prints all the information in it.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">当然，如果你不能从一个</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">address book</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">中取出信息的话，那么它也就没什么用了！下面的例子展示了如何读取上面的程序创建的文件，并将读到的所有信息打印出来。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<div style="mso-element:para-border-div;border:solid #BBBBBB 1.0pt;mso-border-alt:
solid #BBBBBB .75pt;padding:12.0pt 12.0pt 12.0pt 12.0pt;background:#FAFAFA"></p>
<p align="left" class="MsoNormal" style="margin-top:12.0pt;text-align:left;
line-height:12.75pt;mso-pagination:widow-orphan;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
background:#FAFAFA;border:none;mso-border-alt:solid #BBBBBB .75pt;padding:0cm;
mso-padding-alt:12.0pt 12.0pt 12.0pt 12.0pt"><br />
			<span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#880000;mso-font-kerning:0pt">#include</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#008800;mso-font-kerning:0pt">&lt;iostream&gt;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#880000;mso-font-kerning:
0pt">#include</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;
mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#008800;mso-font-kerning:0pt">&lt;fstream&gt;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#880000;mso-font-kerning:
0pt">#include</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;
mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#008800;mso-font-kerning:0pt">&lt;string&gt;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#880000;mso-font-kerning:
0pt">#include</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;
mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#008800;mso-font-kerning:0pt">&quot;addressbook.pb.h&quot;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:
0pt">using</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;
mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#000088;mso-font-kerning:0pt">namespace</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> std</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span></p>
<p>			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#880000;mso-font-kerning:
0pt">// Iterates though all people in the AddressBook and prints info about them.</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:
0pt">void</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;
mso-font-kerning:0pt"> ListPeople</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#666600;mso-font-kerning:0pt">(</span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#000088;mso-font-kerning:0pt">const</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> tutorial</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">AddressBook</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">&amp;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> address_book</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">)</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">{</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">for</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#666600;mso-font-kerning:0pt">(</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:0pt">int</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> i </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">=</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#006666;mso-font-kerning:0pt">0</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> i </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">&lt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> address_book</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">.</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">person_size</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">();</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> i</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">++)</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">{</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">const</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> tutorial</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">Person</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">&amp;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> person </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">=</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> address_book</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">.</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">person</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">(</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">i</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">);</span></p>
<p>			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; cout </span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#666600;mso-font-kerning:0pt">&lt;&lt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#008800;mso-font-kerning:0pt">&quot;Person ID: &quot;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:
0pt">&lt;&lt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;
mso-font-kerning:0pt"> person</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#666600;mso-font-kerning:0pt">.</span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt">id</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">()</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">&lt;&lt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> endl</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; cout </span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#666600;mso-font-kerning:0pt">&lt;&lt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#008800;mso-font-kerning:0pt">&quot; &nbsp;Name: &quot;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:
0pt">&lt;&lt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;
mso-font-kerning:0pt"> person</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#666600;mso-font-kerning:0pt">.</span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt">name</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">()</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">&lt;&lt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> endl</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">if</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#666600;mso-font-kerning:0pt">(</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">person</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">.</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">has_email</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">())</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">{</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; &nbsp; cout </span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#666600;mso-font-kerning:0pt">&lt;&lt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#008800;mso-font-kerning:0pt">&quot; &nbsp;E-mail address: &quot;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;
mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#666600;mso-font-kerning:0pt">&lt;&lt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> person</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">.</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">email</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">()</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">&lt;&lt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> endl</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;
mso-font-kerning:0pt">}</span></p>
<p>			<span lang="EN-US" style="font-size:9.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">for</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#666600;mso-font-kerning:0pt">(</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:0pt">int</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> j </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">=</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#006666;mso-font-kerning:0pt">0</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> j </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">&lt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> person</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">.</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">phone_size</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">();</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> j</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">++)</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">{</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; &nbsp; </span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#000088;mso-font-kerning:0pt">const</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> tutorial</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">Person</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">PhoneNumber</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">&amp;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> phone_number </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">=</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> person</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">.</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">phone</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">(</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">j</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">);</span></p>
<p>			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; &nbsp; </span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#000088;mso-font-kerning:0pt">switch</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">(</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">phone_number</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">.</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">type</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">())</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">{</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; &nbsp; &nbsp; </span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#000088;mso-font-kerning:0pt">case</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> tutorial</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">Person</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">MOBILE</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">:</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cout </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">&lt;&lt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#008800;mso-font-kerning:0pt">&quot; &nbsp;Mobile phone #: &quot;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;
mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:0pt">break</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; &nbsp; &nbsp; </span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#000088;mso-font-kerning:0pt">case</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> tutorial</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">Person</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">HOME</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">:</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cout </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">&lt;&lt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#008800;mso-font-kerning:0pt">&quot; &nbsp;Home phone #: &quot;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;
mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:0pt">break</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; &nbsp; &nbsp; </span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#000088;mso-font-kerning:0pt">case</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> tutorial</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">Person</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">WORK</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">:</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cout </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">&lt;&lt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#008800;mso-font-kerning:0pt">&quot; &nbsp;Work phone #: &quot;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;
mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:0pt">break</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; &nbsp; </span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#666600;mso-font-kerning:0pt">}</span><br />
			<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; &nbsp; cout </span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#666600;mso-font-kerning:0pt">&lt;&lt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> phone_number</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">.</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">number</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">()</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">&lt;&lt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> endl</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;
mso-font-kerning:0pt">}</span><br />
			<span lang="EN-US" style="font-size:9.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;
mso-font-kerning:0pt">}</span><br />
			<span lang="EN-US" style="font-size:9.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:
0pt">}</span></p>
<p>			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#880000;mso-font-kerning:
0pt">// Main function: &nbsp;Reads the entire address book from a file and prints all</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#880000;mso-font-kerning:
0pt">// &nbsp; the information inside.</span><br />
			<span lang="EN-US" style="font-size:
9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:
0pt">int</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt"> main</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;
mso-font-kerning:0pt">(</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#000088;mso-font-kerning:0pt">int</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> argc</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">,</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:0pt">char</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">*</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> argv</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">[])</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">{</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#880000;
mso-font-kerning:0pt">// Verify that the version of the library that we linked against is</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#880000;
mso-font-kerning:0pt">// compatible with the version of the headers we compiled against.</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; GOOGLE_PROTOBUF_VERIFY_VERSION</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span></p>
<p>			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">if</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#666600;mso-font-kerning:0pt">(</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">argc </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">!=</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#006666;mso-font-kerning:0pt">2</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">)</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">{</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; cerr </span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#666600;mso-font-kerning:0pt">&lt;&lt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#008800;mso-font-kerning:0pt">&quot;Usage: &nbsp;&quot;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;
mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#666600;mso-font-kerning:0pt">&lt;&lt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> argv</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">[</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#006666;mso-font-kerning:0pt">0</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">]</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">&lt;&lt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#008800;mso-font-kerning:0pt">&quot; ADDRESS_BOOK_FILE&quot;</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#666600;mso-font-kerning:0pt">&lt;&lt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> endl</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">return</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#666600;mso-font-kerning:0pt">-</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#006666;mso-font-kerning:0pt">1</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;
mso-font-kerning:0pt">}</span></p>
<p>			<span lang="EN-US" style="font-size:9.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; tutorial</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;
mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt">AddressBook address_book</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span></p>
<p>			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;
mso-font-kerning:0pt">{</span><br />
			<span lang="EN-US" style="font-size:9.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#880000;
mso-font-kerning:0pt">// Read the existing address book.</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; fstream input</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#666600;mso-font-kerning:0pt">(</span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt">argv</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">[</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#006666;mso-font-kerning:0pt">1</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">],</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> ios</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#000088;mso-font-kerning:0pt">in</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">|</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> ios</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">binary</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">);</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">if</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#666600;mso-font-kerning:0pt">(!</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">address_book</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">.</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">ParseFromIstream</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">(&amp;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">input</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">))</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">{</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; &nbsp; cerr </span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#666600;mso-font-kerning:0pt">&lt;&lt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#008800;mso-font-kerning:0pt">&quot;Failed to parse address book.&quot;</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#666600;mso-font-kerning:0pt">&lt;&lt;</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> endl</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; &nbsp; </span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#000088;mso-font-kerning:0pt">return</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">-</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#006666;mso-font-kerning:0pt">1</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; &nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;
mso-font-kerning:0pt">}</span><br />
			<span lang="EN-US" style="font-size:9.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;
mso-font-kerning:0pt">}</span></p>
<p>			<span lang="EN-US" style="font-size:9.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; ListPeople</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#666600;mso-font-kerning:0pt">(</span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt">address_book</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">);</span></p>
<p>			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#880000;
mso-font-kerning:0pt">// Optional: &nbsp;Delete all global objects allocated by libprotobuf.</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; google</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;
mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt">protobuf</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">::</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:black;mso-font-kerning:0pt">ShutdownProtobufLibrary</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">();</span></p>
<p>			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:black;mso-font-kerning:
0pt">&nbsp; </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#000088;
mso-font-kerning:0pt">return</span><span lang="EN-US" style="font-size:9.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:
9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:#006666;mso-font-kerning:0pt">0</span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:0pt">;</span><br />
			<span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:
宋体;color:black;mso-font-kerning:0pt"> </span><span lang="EN-US" style="font-size:9.0pt;mso-bidi-font-size:11.0pt;
font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#666600;mso-font-kerning:
0pt">}</span><span lang="EN-US" style="font-size:9.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt"><o:p></o:p></span></p>
</p></div>
<div style="mso-element:para-border-div;border:none;border-top:solid #3366CC 1.0pt;
mso-border-top-alt:solid #3366CC .75pt;padding:1.0pt 0cm 0cm 0cm;background:
#E5ECF9;margin-left:-7.5pt;margin-right:0cm"></p>
<p align="left" class="MsoNormal" style="margin-top:24.0pt;text-align:left;
mso-pagination:widow-orphan;mso-outline-level:2;background:#E5ECF9;border:none;
mso-border-top-alt:solid #3366CC .75pt;padding:0cm;mso-padding-alt:1.0pt 0cm 0cm 0cm"><br />
			<b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">Extending a Protocol Buffer </span></b><b><span style="font-size:15.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">扩展一个</span></b><b><span lang="EN-US" style="font-size:15.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">protocol buffer</span></b><b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
</p></div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">Sooner or later after you release the code that uses your protocol buffer, you will undoubtedly want to &quot;improve&quot; the protocol buffer&#39;s definition. If you want your new buffers to be backwards-compatible, and your old buffers to be forward-compatible &ndash; and you almost certainly do want this &ndash; then there are some rules you need to follow. In the new version of the protocol buffer:<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l17 level1 lfo9;tab-stops:list 36.0pt"><br />
		<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">you&nbsp;<i>must not</i>&nbsp;change the tag numbers of any existing fields.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l17 level1 lfo9;tab-stops:list 36.0pt"><br />
		<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">you&nbsp;<i>must not</i>&nbsp;add or delete any required fields.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l17 level1 lfo9;tab-stops:list 36.0pt"><br />
		<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">you&nbsp;<i>may</i>&nbsp;delete optional or repeated fields.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l17 level1 lfo9;tab-stops:list 36.0pt"><br />
		<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">you&nbsp;<i>may</i>&nbsp;add new optional or repeated fields but you must use fresh tag numbers (i.e. tag numbers that were never used in this protocol buffer, not even by deleted fields).<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">(There are&nbsp;<a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html#updating"><span style="color:#0000CC">some exceptions</span></a>&nbsp;to these rules, but they are rarely used.)<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">If you follow these rules, old code will happily read new messages and simply ignore any new fields. To the old code, optional fields that were deleted will simply have their default value, and deleted repeated fields will be empty. New code will also transparently read old messages. However, keep in mind that new optional fields will not be present in old messages, so you will need to either check explicitly whether they&#39;re set with&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">has_</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">, or provide a reasonable default value in your&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#007000;
mso-font-kerning:0pt">.proto</span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">&nbsp;file with&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#007000;
mso-font-kerning:0pt">[default = value]</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;after the tag number. If the default value is not specified for an optional element, a type-specific default value is used instead: for strings, the default value is the empty string. For booleans, the default value is false. For numeric types, the default value is zero. Note also that if you added a new repeated field, your new code will not be able to tell whether it was left empty (by new code) or never set at all (by old code) since there is no&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:
11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;color:#007000;
mso-font-kerning:0pt">has_</span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">&nbsp;flag for it.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;text-align:left;
line-height:15.0pt;mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">无论或早或晚，在你放出你那使用</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">protocol buffer</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">的代码之后，你必定会想&ldquo;改进&rdquo;</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">protocol buffer</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">的定义。如果你想让你的新</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">buffer</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">向后兼容（</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">backwards-compatible</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">），并且旧的</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">buffer</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">能够向前兼容（</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">forward-compatible</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">）&mdash;&mdash;你一定希望如此&mdash;&mdash;那么你在新的</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">protocol buffer</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:
12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:
Helvetica;mso-bidi-font-family:Helvetica;color:blue;mso-font-kerning:0pt">中就要遵守其他的一些规则了：</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:21.0pt;margin-bottom:.0001pt;text-align:left;
text-indent:-21.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l2 level1 lfo19"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings;color:blue;mso-font-kerning:0pt"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">对已存在的任何字段，你都不能更改其标识（</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">tag</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">）号。</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:21.0pt;margin-bottom:.0001pt;text-align:left;
text-indent:-21.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l2 level1 lfo19"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings;color:blue;mso-font-kerning:0pt"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">你绝对不能添加或删除任何</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">required</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">的字段。</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:21.0pt;margin-bottom:.0001pt;text-align:left;
text-indent:-21.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l2 level1 lfo19"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings;color:blue;mso-font-kerning:0pt"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">你可以添加新的</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">optional</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">或</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">repeated</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">的字段，但是你必须使用新的标识（</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">tag</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">）号（例如，在这个</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">protocol buffer</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:
12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:
Helvetica;mso-bidi-font-family:Helvetica;color:blue;mso-font-kerning:0pt">中从未使用过的标识号&mdash;&mdash;甚至于已经被删除过的字段使用过的标识号也不行）。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;text-align:left;
line-height:15.0pt;mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">（有一些</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:#7030A0;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/proto.html#updating"><span lang="EN-US" style="font-family:宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:
Helvetica;color:#7030A0"><span lang="EN-US">例外情况</span></span></a></span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">，但是它们很少使用。）</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;text-align:left;
line-height:15.0pt;mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">如果你遵守这些规则，老的代码将能很好地解析新的消息（</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">message</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">），并忽略掉任何新的字段。对老代码来说，已经被删除的</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">optional</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">字段将被赋予默认值，已被删除的</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">repeated</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">字段将是空的。新的代码也能够透明地读取旧的消息。但是，请牢记心中：新的</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">optional</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">字段将不会出现在旧的消息中，所以你要么需要显式地检查它们是否由</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">has_</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">前缀的函数置（</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">set</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">）了值，要么在你的</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">.proto</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">文件中，在标识（</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">tag</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">）号的后面用</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt">[default = value]</span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">提供一个合理的默认值。如果没有为一个</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">optional</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">项指定默认值，那么就会使用与特定类型相关的默认值：对</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">string</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">来说，默认值是空字符串。对</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">boolean</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">来说，默认值是</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">false</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">。对数值类型来说，默认值是</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">0</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">。还要注意：如果你添加了一个新的</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">repeated</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">字段，你的新代码将无法告诉你它是否被留空了（被新代码），或者是否从未被置（</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">set</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">）值（被旧代码），这是因为它没有</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">has_</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">标志。</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<div style="mso-element:para-border-div;border:none;border-top:solid #3366CC 1.0pt;
mso-border-top-alt:solid #3366CC .75pt;padding:1.0pt 0cm 0cm 0cm;background:
#E5ECF9;margin-left:-7.5pt;margin-right:0cm"></p>
<p align="left" class="MsoNormal" style="margin-top:24.0pt;text-align:left;
mso-pagination:widow-orphan;mso-outline-level:2;background:#E5ECF9;border:none;
mso-border-top-alt:solid #3366CC .75pt;padding:0cm;mso-padding-alt:1.0pt 0cm 0cm 0cm"><br />
			<b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">Optimization Tips </span></b><b><span style="font-size:15.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">优化小技巧</span></b><b><span lang="EN-US" style="font-size:
15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
</p></div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">The C++ Protocol Buffers library is extremely heavily optimized. However, proper usage can improve performance even more. Here are some tips for squeezing every last drop of speed out of the library:<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l5 level1 lfo10;tab-stops:list 36.0pt"><br />
		<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">Reuse message objects when possible. Messages try to keep around any memory they allocate for reuse, even when they are cleared. Thus, if you are handling many messages with the same type and similar structure in succession, it is a good idea to reuse the same message object each time to take load off the memory allocator. However, objects can become bloated over time, especially if your messages vary in &quot;shape&quot; or if you occasionally construct a message that is much larger than usual. You should monitor the sizes of your message objects by calling the&nbsp;</span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;mso-bidi-font-family:宋体;
color:#007000;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/reference/cpp/google.protobuf.message.html#Message.SpaceUsed.details"><span style="color:#0000CC">SpaceUsed</span></a></span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt">&nbsp;method and delete them once they get too big.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:29.25pt;margin-bottom:.0001pt;text-align:left;
text-indent:-18.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l5 level1 lfo10;tab-stops:list 36.0pt"><br />
		<span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;
mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;color:black;
mso-font-kerning:0pt"><span style="mso-list:Ignore">&middot;<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">Your system&#39;s memory allocator may not be well-optimized for allocating lots of small objects from multiple threads. Try using&nbsp;</span><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:red;mso-font-kerning:0pt"><a href="http://code.google.com/p/google-perftools/"><span style="color:red">Google&#39;s tcmalloc</span></a></span></b><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">&nbsp;instead.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;text-align:left;
line-height:15.0pt;mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">Protocol Buffer </span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">的</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">C++</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">库已经做了极度优化。但是，正确的使用方法仍然会提高很多性能。下面是一些小技巧，用来提升</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">protocol buffer</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:
12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:
Helvetica;mso-bidi-font-family:Helvetica;color:blue;mso-font-kerning:0pt">库的最后一丝速度能力：</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:21.0pt;margin-bottom:.0001pt;text-align:left;
text-indent:-21.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l16 level1 lfo18"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings;color:blue;mso-font-kerning:0pt"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">如果有可能，重复利用消息（</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">message</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">）对象。即使被清除掉，消息（</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">message</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">）对象也会尽量保存所有被分配来重用的内存。这样的话，如果你正在处理很多类型相同的消息以及一系列相似的结构，有一个好办法就是重复使用同一个消息（</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">message</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">）对象，从而使内存分配的压力减小一些。然而，随着时间的流逝，对象占用的内存也有可能变得越来越大，尤其是当你的消息尺寸（译者注：各消息内容不同，有些消息内容多一些，有些消息内容少一些）不同的时候，或者你偶尔创建了一个比平常大很多的消息（</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">message</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">）的时候。你应该自己监测消息（</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">message</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">）对象的大小&mdash;&mdash;通过调用</span></b><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/reference/cpp/google.protobuf.message.html#Message.SpaceUsed.details"><span style="color:#0000CC">SpaceUsed</span></a></span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">函数&mdash;&mdash;并在它太大的时候删除它。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;margin-right:0cm;
margin-bottom:0cm;margin-left:21.0pt;margin-bottom:.0001pt;text-align:left;
text-indent:-21.0pt;line-height:15.0pt;mso-pagination:widow-orphan;mso-list:
l16 level1 lfo18"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:
Wingdings;color:blue;mso-font-kerning:0pt"><span style="mso-list:Ignore">l<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp; </span></span></span><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">在多线程中分配大量小对象的内存的时候，你的操作系统的内存分配器可能优化得不够好。在这种情况下，你可以尝试用一下</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:red;mso-font-kerning:0pt"><a href="http://code.google.com/p/google-perftools/"><span style="color:red">Google&#39;s tcmalloc</span></a></span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<div style="mso-element:para-border-div;border:none;border-top:solid #3366CC 1.0pt;
mso-border-top-alt:solid #3366CC .75pt;padding:1.0pt 0cm 0cm 0cm;background:
#E5ECF9;margin-left:-7.5pt;margin-right:0cm"></p>
<p align="left" class="MsoNormal" style="margin-top:24.0pt;text-align:left;
mso-pagination:widow-orphan;mso-outline-level:2;background:#E5ECF9;border:none;
mso-border-top-alt:solid #3366CC .75pt;padding:0cm;mso-padding-alt:1.0pt 0cm 0cm 0cm"><br />
			<b><span lang="EN-US" style="font-size:15.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt">Advanced Usage </span></b><b><span style="font-size:15.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">高级使用</span></b><b><span lang="EN-US" style="font-size:15.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
</p></div>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">Protocol buffers have uses that go beyond simple accessors and serialization. Be sure to explore the&nbsp;<a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/reference/cpp/index.html"><span style="color:#0000CC">C++ API reference</span></a>&nbsp;to see what else you can do with them.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">One key feature provided by protocol message classes is&nbsp;<i>reflection</i>. You can iterate over the fields of a message and manipulate their values without writing your code against any specific message type. One very useful way to use reflection is for converting protocol messages to and from other encodings, such as XML or JSON. A more advanced use of reflection might be to find differences between two messages of the same type, or to develop a sort of &quot;regular expressions for protocol messages&quot; in which you can write expressions that match certain message contents. If you use your imagination, it&#39;s possible to apply Protocol Buffers to a much wider range of problems than you might initially expect!<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="text-align:left;line-height:15.0pt;
mso-pagination:widow-orphan"><br />
		<span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;mso-font-kerning:0pt">Reflection is provided by the&nbsp;<a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/reference/cpp/google.protobuf.message.html#Message.Reflection"><span style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000">Message::Reflection</span><span style="color:#0000CC">&nbsp;interface</span></a>.<o:p></o:p></span></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;text-align:left;
line-height:15.0pt;mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">Protocol Buffers</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">的作用绝不仅仅是简单的数据存取以及序列化。请阅读</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:black;mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/reference/cpp/index.html"><span style="color:#0000CC">C++ API reference</span></a></span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">全文来看看你还能用它来做什么。</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;text-align:left;
line-height:15.0pt;mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">protocol</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">消息类所提供的一个关键特性就是</span></b><b style="mso-bidi-font-weight:
normal"><i style="mso-bidi-font-style:normal"><span style="font-size:12.0pt;
font-family:宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;
mso-bidi-font-family:Helvetica;color:#7030A0;mso-font-kerning:0pt">反射</span></i></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">。你不需要编写针对一个特殊的消息（</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">message</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">）类型的代码，就可以遍历一个消息的字段，并操纵它们的值，就像</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">XML</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:
Helvetica;color:blue;mso-font-kerning:0pt">和</span></b><b style="mso-bidi-font-weight:
normal"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;
color:blue;mso-font-kerning:0pt">JSON</span></b><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">一样。&ldquo;反射&rdquo;的一个更高级的用法可能就是可以找出两个相同类型的消息之间的区别，或者开发某种&ldquo;协议消息的正则表达式&rdquo;，利用正则表达式，你可以对某种消息内容进行匹配。只要你发挥你的想像力，就有可能将</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt">Protocol Buffers</span></b><b style="mso-bidi-font-weight:normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Helvetica;
mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;color:blue;
mso-font-kerning:0pt">应用到一个更广泛的、你可能一开始就期望解决的问题范围上。</span></b><b style="mso-bidi-font-weight:normal"><span lang="EN-US" style="font-size:12.0pt;
font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:blue;mso-font-kerning:0pt"><o:p></o:p></span></b></p>
<p align="left" class="MsoNormal" style="margin-top:3.6pt;text-align:left;
line-height:15.0pt;mso-pagination:widow-orphan"><br />
		<b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">&ldquo;反射&rdquo;是由</span></b><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:black;
mso-font-kerning:0pt"><a href="http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/reference/cpp/google.protobuf.message.html#Message.Reflection"><span style="font-size:10.0pt;mso-bidi-font-size:11.0pt;font-family:&quot;Courier New&quot;;
mso-bidi-font-family:宋体;color:#007000">Message::Reflection</span><span style="color:#0000CC">&nbsp;interface</span></a></span><b style="mso-bidi-font-weight:
normal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
Helvetica;mso-hansi-font-family:Helvetica;mso-bidi-font-family:Helvetica;
color:blue;mso-font-kerning:0pt">提供的。</span></b></p>
</div>
<div align="left" style="margin-left:-7.5pt;text-align:left;
line-height:26.25pt;"></p>
<div align="left" style="margin-top:3.6pt;text-align:left;
line-height:15.0pt;"><br />
		<br />
		<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
		<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;版权声明&nbsp;<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;<br />
		转载需注明出处：<u><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><em><span style="color: rgb(0, 0, 255);"><strong style="font-size: 16px;"><span style="font-family: arial, helvetica, sans-serif;">codelast.com</span></strong></span></em></a></u>&nbsp;<br />
		感谢关注我的微信公众号（微信扫一扫）：</p>
<p style="border: 0px; font-size: 13px; margin: 0px 0px 9px; outline: 0px; padding: 0px; color: rgb(77, 77, 77);">
			<img decoding="async" alt="wechat qrcode of codelast" src="https://www.codelast.com/codelast_wechat_qr_code.jpg" style="width: 200px; height: 200px;" /></p>
</p></div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codelast.com/%e5%8e%9f%e5%88%9b-protocol-buffer-basics-c%e4%b8%ad%e6%96%87%e7%bf%bb%e8%af%91%ef%bc%88google-protocol-buffers%e4%b8%ad%e6%96%87%e6%95%99%e7%a8%8b%ef%bc%89/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
