<?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/%E4%B8%AD%E6%96%87/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.codelast.com</link>
	<description>最优化之路</description>
	<lastBuildDate>Thu, 23 Mar 2023 09:10:14 +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>[原创] JAVA sun HttpServer在handler中返回含中文的response应该怎么处理</title>
		<link>https://www.codelast.com/%e5%8e%9f%e5%88%9b-java-sun-httpserver%e5%9c%a8handler%e4%b8%ad%e8%bf%94%e5%9b%9e%e5%90%ab%e4%b8%ad%e6%96%87%e7%9a%84response%e5%ba%94%e8%af%a5%e6%80%8e%e4%b9%88%e5%a4%84%e7%90%86/</link>
					<comments>https://www.codelast.com/%e5%8e%9f%e5%88%9b-java-sun-httpserver%e5%9c%a8handler%e4%b8%ad%e8%bf%94%e5%9b%9e%e5%90%ab%e4%b8%ad%e6%96%87%e7%9a%84response%e5%ba%94%e8%af%a5%e6%80%8e%e4%b9%88%e5%a4%84%e7%90%86/#respond</comments>
		
		<dc:creator><![CDATA[learnhard]]></dc:creator>
		<pubDate>Thu, 23 Mar 2023 09:10:14 +0000</pubDate>
				<category><![CDATA[原创]]></category>
		<category><![CDATA[综合]]></category>
		<category><![CDATA[handler]]></category>
		<category><![CDATA[JAVA sun HttpServer]]></category>
		<category><![CDATA[中文]]></category>
		<guid isPermaLink="false">https://www.codelast.com/?p=13856</guid>

					<description><![CDATA[<div>
	在JAVA中，使用sun HttpServer实现一个web server的时候，使用了下面的hander类来处理请求：</div>
<div>
<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="java language-java 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;"><span class="hljs-keyword" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">static</span>&#160;<span class="hljs-class" style="font-size: inherit; color: inherit; line-height: inherit; margin: 0px; padding: 0px; word-wrap: inherit !important; word-break: inherit !important;"><span class="hljs-keyword" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">class</span>&#160;<span class="hljs-title" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(165, 218, 45); word-wrap: inherit !important; word-break: inherit !important;">MyHandler</span>&#160;<span class="hljs-keyword" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">implements</span>&#160;<span class="hljs-title" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(165, 218, 45); word-wrap: inherit !important; word-break: inherit !important;">HttpHandler</span>&#160;</span>{
&#160;&#160;<span class="hljs-meta" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(91, 218, 237); word-wrap: inherit !important; word-break: inherit !important;">@Override</span>
&#160;&#160;<span class="hljs-function" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;"><span class="hljs-keyword" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; overflow-wrap: inherit !important; word-break: inherit !important;">public</span>&#160;<span class="hljs-keyword" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; overflow-wrap: inherit !important; word-break: inherit !important;">void</span>&#160;<span class="hljs-title" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(165, 218, 45); word-wrap: inherit !important; word-break: inherit !important;">handle</span><span class="hljs-params" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(255, 152, 35); word-wrap: inherit !important; word-break: inherit !important;">(HttpExchange&#160;httpExchange)</span>&#160;<span class="hljs-keyword" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; overflow-wrap: inherit !important; word-break: inherit !important;">throws</span>&#160;IOException&#160;</span>{
&#160;&#160;&#160;&#160;String&#160;response&#160;=&#160;<span class="hljs-string" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(238, 220, 112); word-wrap: inherit !important; word-break: inherit !important;">&#34;test&#34;</span>;&#160;&#160;<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;">//&#160;返回固定内容</span>
&#160;&#160;&#160;&#160;httpExchange.sendResponseHeaders(<span class="hljs-number" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(174, 135, 250); word-wrap: inherit !important; word-break: inherit !important;">200</span>,&#160;response.length());
&#160;&#160;&#160;&#160;OutputStream&#160;os&#160;=&#160;httpExchange.getResponseBody();
&#160;&#160;&#160;&#160;os.write(response.getBytes());
&#160;&#160;&#160;&#160;os.close();
&#160;&#160;}
}
</code></pre>
</section>
</div>
<div>
<span id="more-13856"></span>	<br />
	如果要在response里返回带中文的内容，例如：</div>
<blockquote>
<div>
		String response = &#34;中文&#34;;</div>
</blockquote>
<div>
	那么你就会发现访问这个web server返回的是null，这说明handler实现有问题。那么代码应该怎么改？<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></div>&#8230; <a href="https://www.codelast.com/%e5%8e%9f%e5%88%9b-java-sun-httpserver%e5%9c%a8handler%e4%b8%ad%e8%bf%94%e5%9b%9e%e5%90%ab%e4%b8%ad%e6%96%87%e7%9a%84response%e5%ba%94%e8%af%a5%e6%80%8e%e4%b9%88%e5%a4%84%e7%90%86/" class="read-more">Read More </a>]]></description>
										<content:encoded><![CDATA[<div>
	在JAVA中，使用sun HttpServer实现一个web server的时候，使用了下面的hander类来处理请求：</div>
<div>
<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="java language-java 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;"><span class="hljs-keyword" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">static</span>&nbsp;<span class="hljs-class" style="font-size: inherit; color: inherit; line-height: inherit; margin: 0px; padding: 0px; word-wrap: inherit !important; word-break: inherit !important;"><span class="hljs-keyword" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">class</span>&nbsp;<span class="hljs-title" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(165, 218, 45); word-wrap: inherit !important; word-break: inherit !important;">MyHandler</span>&nbsp;<span class="hljs-keyword" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">implements</span>&nbsp;<span class="hljs-title" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(165, 218, 45); word-wrap: inherit !important; word-break: inherit !important;">HttpHandler</span>&nbsp;</span>{
&nbsp;&nbsp;<span class="hljs-meta" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(91, 218, 237); word-wrap: inherit !important; word-break: inherit !important;">@Override</span>
&nbsp;&nbsp;<span class="hljs-function" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;"><span class="hljs-keyword" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; overflow-wrap: inherit !important; word-break: inherit !important;">public</span>&nbsp;<span class="hljs-keyword" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; overflow-wrap: inherit !important; word-break: inherit !important;">void</span>&nbsp;<span class="hljs-title" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(165, 218, 45); word-wrap: inherit !important; word-break: inherit !important;">handle</span><span class="hljs-params" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(255, 152, 35); word-wrap: inherit !important; word-break: inherit !important;">(HttpExchange&nbsp;httpExchange)</span>&nbsp;<span class="hljs-keyword" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; overflow-wrap: inherit !important; word-break: inherit !important;">throws</span>&nbsp;IOException&nbsp;</span>{
&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;response&nbsp;=&nbsp;<span class="hljs-string" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(238, 220, 112); word-wrap: inherit !important; word-break: inherit !important;">&quot;test&quot;</span>;&nbsp;&nbsp;<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;">//&nbsp;返回固定内容</span>
&nbsp;&nbsp;&nbsp;&nbsp;httpExchange.sendResponseHeaders(<span class="hljs-number" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(174, 135, 250); word-wrap: inherit !important; word-break: inherit !important;">200</span>,&nbsp;response.length());
&nbsp;&nbsp;&nbsp;&nbsp;OutputStream&nbsp;os&nbsp;=&nbsp;httpExchange.getResponseBody();
&nbsp;&nbsp;&nbsp;&nbsp;os.write(response.getBytes());
&nbsp;&nbsp;&nbsp;&nbsp;os.close();
&nbsp;&nbsp;}
}
</code></pre>
</section>
</div>
<div>
<span id="more-13856"></span>	<br />
	如果要在response里返回带中文的内容，例如：</div>
<blockquote>
<div>
		String response = &quot;中文&quot;;</div>
</blockquote>
<div>
	那么你就会发现访问这个web server返回的是null，这说明handler实现有问题。那么代码应该怎么改？<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 />
	如下：</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="java language-java 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;"><span class="hljs-keyword" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">static</span>&nbsp;<span class="hljs-class" style="font-size: inherit; color: inherit; line-height: inherit; margin: 0px; padding: 0px; word-wrap: inherit !important; word-break: inherit !important;"><span class="hljs-keyword" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">class</span>&nbsp;<span class="hljs-title" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(165, 218, 45); word-wrap: inherit !important; word-break: inherit !important;">MyHandler</span>&nbsp;<span class="hljs-keyword" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">implements</span>&nbsp;<span class="hljs-title" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(165, 218, 45); word-wrap: inherit !important; word-break: inherit !important;">HttpHandler</span>&nbsp;</span>{
&nbsp;&nbsp;<span class="hljs-meta" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(91, 218, 237); word-wrap: inherit !important; word-break: inherit !important;">@Override</span>
&nbsp;&nbsp;<span class="hljs-function" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;"><span class="hljs-keyword" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; overflow-wrap: inherit !important; word-break: inherit !important;">public</span>&nbsp;<span class="hljs-keyword" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; overflow-wrap: inherit !important; word-break: inherit !important;">void</span>&nbsp;<span class="hljs-title" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(165, 218, 45); word-wrap: inherit !important; word-break: inherit !important;">handle</span><span class="hljs-params" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(255, 152, 35); word-wrap: inherit !important; word-break: inherit !important;">(HttpExchange&nbsp;httpExchange)</span>&nbsp;<span class="hljs-keyword" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; overflow-wrap: inherit !important; word-break: inherit !important;">throws</span>&nbsp;IOException&nbsp;</span>{
&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;response&nbsp;=&nbsp;<span class="hljs-string" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(238, 220, 112); word-wrap: inherit !important; word-break: inherit !important;">&quot;中文&quot;</span>;
&nbsp;&nbsp;&nbsp;&nbsp;<span class="hljs-keyword" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">byte</span>[]&nbsp;bytes&nbsp;=&nbsp;response.getBytes(StandardCharsets.UTF_8);&nbsp;<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;">//&nbsp;转换为字节数组，指定编码为UTF-8</span>
&nbsp;&nbsp;&nbsp;&nbsp;httpExchange.sendResponseHeaders(<span class="hljs-number" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(174, 135, 250); word-wrap: inherit !important; word-break: inherit !important;">200</span>,&nbsp;bytes.length);
&nbsp;&nbsp;&nbsp;&nbsp;OutputStream&nbsp;os&nbsp;=&nbsp;httpExchange.getResponseBody();
&nbsp;&nbsp;&nbsp;&nbsp;os.write(bytes);
&nbsp;&nbsp;&nbsp;&nbsp;os.close();
&nbsp;&nbsp;}
}
</code></pre>
</section>
</div>
<div>
	此时你会发现，向server发请求返回的不再是null而是正确的内容了。</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 />
		感谢关注我的微信公众号（微信扫一扫）：<br />
		<img decoding="async" alt="wechat qrcode of codelast" src="https://www.codelast.com/codelast_wechat_qr_code.jpg" style="color: rgb(77, 77, 77); font-size: 13px; 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-java-sun-httpserver%e5%9c%a8handler%e4%b8%ad%e8%bf%94%e5%9b%9e%e5%90%ab%e4%b8%ad%e6%96%87%e7%9a%84response%e5%ba%94%e8%af%a5%e6%80%8e%e4%b9%88%e5%a4%84%e7%90%86/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[原创]《使用 fastText 做中文文本分类》文章合集</title>
		<link>https://www.codelast.com/%e5%8e%9f%e5%88%9b%e3%80%8a%e4%bd%bf%e7%94%a8-fasttext-%e5%81%9a%e4%b8%ad%e6%96%87%e6%96%87%e6%9c%ac%e5%88%86%e7%b1%bb%e3%80%8b%e6%96%87%e7%ab%a0%e5%90%88%e9%9b%86/</link>
					<comments>https://www.codelast.com/%e5%8e%9f%e5%88%9b%e3%80%8a%e4%bd%bf%e7%94%a8-fasttext-%e5%81%9a%e4%b8%ad%e6%96%87%e6%96%87%e6%9c%ac%e5%88%86%e7%b1%bb%e3%80%8b%e6%96%87%e7%ab%a0%e5%90%88%e9%9b%86/#respond</comments>
		
		<dc:creator><![CDATA[learnhard]]></dc:creator>
		<pubDate>Wed, 29 Jul 2020 10:46:59 +0000</pubDate>
				<category><![CDATA[Algorithm]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[fastText]]></category>
		<category><![CDATA[中文]]></category>
		<category><![CDATA[文本分类]]></category>
		<guid isPermaLink="false">https://www.codelast.com/?p=12856</guid>

					<description><![CDATA[<p>本文描述了如何使用 <a href="https://fasttext.cc/" rel="noopener noreferrer" target="_blank"><span style="background-color:#fff0f5;">fastText</span></a> 对中文进行文本分类的过程，只有实操，基本没有理论。<br />
以下按顺序编排。</p>
<p><span style="background-color: rgb(255, 255, 0);">✓</span>&#160;<a href="https://www.codelast.com/?p=12754" rel="noopener noreferrer" target="_blank">使用 fastText 做中文文本分类(1)</a><br />
<span style="background-color: rgb(255, 255, 0);">✓</span>&#160;<a href="https://www.codelast.com/?p=12777" rel="noopener noreferrer" target="_blank">使用 fastText 做中文文本分类(2)</a><br />
<span style="background-color: rgb(255, 255, 0);">✓</span>&#160;<a href="https://www.codelast.com/?p=12796" rel="noopener noreferrer" target="_blank">使用 fastText 做中文文本分类(3)</a><br />
<span style="background-color: rgb(255, 255, 0);">✓</span>&#160;<a href="https://www.codelast.com/?p=12827" rel="noopener noreferrer" target="_blank">使用 fastText 做中文文本分类(4)</a><br />
<span style="background-color: rgb(255, 255, 0);">✓</span>&#160;<a href="https://www.codelast.com/?p=12840" rel="noopener noreferrer" target="_blank">使用 fastText 做中文文本分类(5)</a>&#8230; <a href="https://www.codelast.com/%e5%8e%9f%e5%88%9b%e3%80%8a%e4%bd%bf%e7%94%a8-fasttext-%e5%81%9a%e4%b8%ad%e6%96%87%e6%96%87%e6%9c%ac%e5%88%86%e7%b1%bb%e3%80%8b%e6%96%87%e7%ab%a0%e5%90%88%e9%9b%86/" class="read-more">Read More </a></p>]]></description>
										<content:encoded><![CDATA[<p>本文描述了如何使用 <a href="https://fasttext.cc/" rel="noopener noreferrer" target="_blank"><span style="background-color:#fff0f5;">fastText</span></a> 对中文进行文本分类的过程，只有实操，基本没有理论。<br />
以下按顺序编排。</p>
<p><span style="background-color: rgb(255, 255, 0);">✓</span>&nbsp;<a href="https://www.codelast.com/?p=12754" rel="noopener noreferrer" target="_blank">使用 fastText 做中文文本分类(1)</a><br />
<span style="background-color: rgb(255, 255, 0);">✓</span>&nbsp;<a href="https://www.codelast.com/?p=12777" rel="noopener noreferrer" target="_blank">使用 fastText 做中文文本分类(2)</a><br />
<span style="background-color: rgb(255, 255, 0);">✓</span>&nbsp;<a href="https://www.codelast.com/?p=12796" rel="noopener noreferrer" target="_blank">使用 fastText 做中文文本分类(3)</a><br />
<span style="background-color: rgb(255, 255, 0);">✓</span>&nbsp;<a href="https://www.codelast.com/?p=12827" rel="noopener noreferrer" target="_blank">使用 fastText 做中文文本分类(4)</a><br />
<span style="background-color: rgb(255, 255, 0);">✓</span>&nbsp;<a href="https://www.codelast.com/?p=12840" rel="noopener noreferrer" target="_blank">使用 fastText 做中文文本分类(5)</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codelast.com/%e5%8e%9f%e5%88%9b%e3%80%8a%e4%bd%bf%e7%94%a8-fasttext-%e5%81%9a%e4%b8%ad%e6%96%87%e6%96%87%e6%9c%ac%e5%88%86%e7%b1%bb%e3%80%8b%e6%96%87%e7%ab%a0%e5%90%88%e9%9b%86/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[原创] 使用 fastText 做中文文本分类(5)</title>
		<link>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e4%bd%bf%e7%94%a8-fasttext-%e5%81%9a%e4%b8%ad%e6%96%87%e6%96%87%e6%9c%ac%e5%88%86%e7%b1%bb5/</link>
					<comments>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e4%bd%bf%e7%94%a8-fasttext-%e5%81%9a%e4%b8%ad%e6%96%87%e6%96%87%e6%9c%ac%e5%88%86%e7%b1%bb5/#respond</comments>
		
		<dc:creator><![CDATA[learnhard]]></dc:creator>
		<pubDate>Wed, 29 Jul 2020 09:48:07 +0000</pubDate>
				<category><![CDATA[Algorithm]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[fastText]]></category>
		<category><![CDATA[FastText4j]]></category>
		<category><![CDATA[中文]]></category>
		<category><![CDATA[文本分类]]></category>
		<guid isPermaLink="false">https://www.codelast.com/?p=12840</guid>

					<description><![CDATA[<p>查看本系列文章合集，请看<a href="https://www.codelast.com/?p=12856" rel="noopener noreferrer" target="_blank"><span style="background-color: rgb(255, 160, 122);">这里</span></a>。</p>
<p>前面说的模型训练、预测过程，是用 fastText 可执行程序完成的。fastText提供了Python的接口，同样的功能也可以用Python实现。如果数据量比较小，单机做文本分类没啥问题。但我的数据量比较大，几十G的文本数据，单机加载模型、预测分类太耗资源了，而且速度慢。<br />
并行这种事嘛，交给Map-Reduce job来做是最合适不过了，不过，要在Hadoop集群上安装fastText的Python包是不可能的，所以我只能找一下，fastText的模型怎么用Java加载，从而在M-R job中并行地去做预测。<br />
<span id="more-12840"></span><br />
<span style="background-color: rgb(255, 255, 0);">✓</span>&#160;选择<br />
网上能搜到好些个 fastText 的&#8220;Java版&#8221;，比如 <a href="https://github.com/vinhkhuc/JFastText" rel="noopener noreferrer" target="_blank"><span style="background-color:#fff0f5;">JFastText</span></a>，它是 fastText 的一个Java wrapper；又比如&#160;<a href="https://github.com/mayabot/mynlp/tree/master/fastText4j" rel="noopener noreferrer" target="_blank"><span style="background-color:#fff0f5;">FastText4j</span></a>，它是一个完全由 Kotlin &#38; Java 实现的 fastText 实现。还有其他的，没有调研。<br />
看了 FastText4j 的自我介绍：</p>
<blockquote>
<div>
		● 100%由Kotlin &#38; Java实现</div>
<div>
		● 良好的API</div>
<div>
		● 兼容官方原版的预训练模型</div>
<div>
		● 提供所有的包括train、test等api</div>
<div>
		● 支持自有模型存储格式，可以使用MMAP快速加载大模型</div>
</blockquote>
<div>
	我心动了，马上试用。
<p>	<span style="background-color: rgb(255, 255, 0);">✓</span>&#160;Maven项目引入 FastText4j 依赖</p>
<pre style="background-color:#2b2b2b;color:#a9b7c6;font-family:'JetBrains Mono',monospace;font-size:12.0pt;">
<span style="color:#e8bf6a;">&#60;dependency&#62;
</span><span style="color:#e8bf6a;">  &#60;groupId&#62;</span>com.mayabot.mynlp</pre></div>&#8230; <a href="https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e4%bd%bf%e7%94%a8-fasttext-%e5%81%9a%e4%b8%ad%e6%96%87%e6%96%87%e6%9c%ac%e5%88%86%e7%b1%bb5/" class="read-more">Read More </a>]]></description>
										<content:encoded><![CDATA[<p>查看本系列文章合集，请看<a href="https://www.codelast.com/?p=12856" rel="noopener noreferrer" target="_blank"><span style="background-color: rgb(255, 160, 122);">这里</span></a>。</p>
<p>前面说的模型训练、预测过程，是用 fastText 可执行程序完成的。fastText提供了Python的接口，同样的功能也可以用Python实现。如果数据量比较小，单机做文本分类没啥问题。但我的数据量比较大，几十G的文本数据，单机加载模型、预测分类太耗资源了，而且速度慢。<br />
并行这种事嘛，交给Map-Reduce job来做是最合适不过了，不过，要在Hadoop集群上安装fastText的Python包是不可能的，所以我只能找一下，fastText的模型怎么用Java加载，从而在M-R job中并行地去做预测。<br />
<span id="more-12840"></span><br />
<span style="background-color: rgb(255, 255, 0);">✓</span>&nbsp;选择<br />
网上能搜到好些个 fastText 的&ldquo;Java版&rdquo;，比如 <a href="https://github.com/vinhkhuc/JFastText" rel="noopener noreferrer" target="_blank"><span style="background-color:#fff0f5;">JFastText</span></a>，它是 fastText 的一个Java wrapper；又比如&nbsp;<a href="https://github.com/mayabot/mynlp/tree/master/fastText4j" rel="noopener noreferrer" target="_blank"><span style="background-color:#fff0f5;">FastText4j</span></a>，它是一个完全由 Kotlin &amp; Java 实现的 fastText 实现。还有其他的，没有调研。<br />
看了 FastText4j 的自我介绍：</p>
<blockquote>
<div>
		● 100%由Kotlin &amp; Java实现</div>
<div>
		● 良好的API</div>
<div>
		● 兼容官方原版的预训练模型</div>
<div>
		● 提供所有的包括train、test等api</div>
<div>
		● 支持自有模型存储格式，可以使用MMAP快速加载大模型</div>
</blockquote>
<div>
	我心动了，马上试用。</p>
<p>	<span style="background-color: rgb(255, 255, 0);">✓</span>&nbsp;Maven项目引入 FastText4j 依赖</p>
<pre style="background-color:#2b2b2b;color:#a9b7c6;font-family:'JetBrains Mono',monospace;font-size:12.0pt;">
<span style="color:#e8bf6a;">&lt;dependency&gt;
</span><span style="color:#e8bf6a;">  &lt;groupId&gt;</span>com.mayabot.mynlp<span style="color:#e8bf6a;">&lt;/groupId&gt;
</span><span style="color:#e8bf6a;">  &lt;artifactId&gt;</span>fastText4j<span style="color:#e8bf6a;">&lt;/artifactId&gt;
</span><span style="color:#e8bf6a;">  &lt;version&gt;</span>3.1.7<span style="color:#e8bf6a;">&lt;/version&gt;
</span><span style="color:#e8bf6a;">&lt;/dependency&gt;</span></pre>
<p>	这样就能在代码里用了。<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="background-color: rgb(255, 255, 0);">✓</span>&nbsp;训练模型</p>
<pre style="background-color:#2b2b2b;color:#a9b7c6;font-family:'JetBrains Mono',monospace;font-size:12.0pt;">
<span style="color:#808080;">// </span><span style="color:#808080;font-family:'DejaVu Sans Mono',monospace;">用</span><span style="color:#808080;">FastText4j</span><span style="color:#808080;font-family:'DejaVu Sans Mono',monospace;">训练一个文本分类模型，模型保存成单个文件
</span>File trainFile = <span style="color:#cc7832;">new </span>File(<span style="color:#6a8759;">&quot;/home/codelast/labeled-data_train&quot;</span>)<span style="color:#cc7832;">;
</span>InputArgs inputArgs = <span style="color:#cc7832;">new </span>InputArgs()<span style="color:#cc7832;">;
</span>inputArgs.setLoss(LossName.<span style="color:#9876aa;font-style:italic;">softmax</span>)<span style="color:#cc7832;">;
</span>inputArgs.setLr(<span style="color:#6897bb;">1.0</span>)<span style="color:#cc7832;">;
</span>inputArgs.setEpoch(<span style="color:#6897bb;">25</span>)<span style="color:#cc7832;">;
</span>inputArgs.setWordNgrams(<span style="color:#6897bb;">2</span>)<span style="color:#cc7832;">;
</span>
FastText model = FastText.<span style="font-style:italic;">trainSupervised</span>(trainFile<span style="color:#cc7832;">, </span>inputArgs)<span style="color:#cc7832;">;
</span>model.saveModelToSingleFile(<span style="color:#cc7832;">new </span>File(<span style="color:#6a8759;">&quot;/home/codelast/model&quot;</span>))<span style="color:#cc7832;">;</span></pre>
<p>	训练的参数，包括 lr，epoch，wordNgrams 的含义，都和 fastText 的原版一致。和 fastText 默认生成 .bin &amp; .vec 两个模型文件不同，FastText4j 可以用 saveModelToSingleFile() 方法来生成一个单一的模型文件，如果用 saveModel() 方法的话，则会在一个目录下生成4个文件（如果是这种形式的话，加载模型的时候，4个文件缺一不可）：</p>
<blockquote>
<div>
			args.bin</div>
<div>
			dict.bin</div>
<div>
			input.matrix</div>
<div>
			output.matrix</div>
</blockquote>
<div>
		如果要在Java Map-Reduce job中加载模型，把模型放到 distributed cache 中分发，当然是一个文件最方便。所以强烈建议把模型save成单一文件。<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="background-color: rgb(255, 255, 0);">✓</span>&nbsp;加载模型并测试效果</p>
<pre style="background-color:#2b2b2b;color:#a9b7c6;font-family:'JetBrains Mono',monospace;font-size:12.0pt;">
<span style="color:#808080;">// </span><span style="color:#808080;font-family:'DejaVu Sans Mono',monospace;">加载模型
</span>FastText model = FastText.<span style="color:#9876aa;font-style:italic;">Companion</span>.loadModelFromSingleFile(<span style="color:#cc7832;">new </span>File(<span style="color:#6a8759;">&quot;/home/codelast/model&quot;</span>))<span style="color:#cc7832;">;
</span>System.<span style="color:#9876aa;font-style:italic;">out</span>.println(<span style="color:#6a8759;">&quot;load model done, will do test...&quot;</span>)<span style="color:#cc7832;">;
</span><span style="color:#808080;">// </span><span style="color:#808080;font-family:'DejaVu Sans Mono',monospace;">测试模型效果
</span>model.test(<span style="color:#cc7832;">new </span>File(<span style="color:#6a8759;">&quot;/home/codelast/labeled-data_valid&quot;</span>)<span style="color:#cc7832;">, </span><span style="color:#6897bb;">1</span><span style="color:#cc7832;">, </span><span style="color:#6897bb;">0</span><span style="color:#cc7832;">, true</span>)<span style="color:#cc7832;">;</span></pre>
<p>		输出：</p>
<blockquote>
<div>
				load model done, will do test...</div>
<div>
				F1-Score : 0.953652 Precision : 0.949348 Recall : 0.957996&nbsp; __label__娱乐</div>
<div>
				F1-Score : 0.704064 Precision : 0.702055 Recall : 0.706085&nbsp; __label__社会</div>
<div>
				F1-Score : 0.929426 Precision : 0.917355 Recall : 0.941818&nbsp; __label__历史</div>
<div>
				F1-Score : 0.784775 Precision : 0.784232 Recall : 0.785319&nbsp; __label__时政</div>
<div>
				F1-Score : 0.969314 Precision : 0.967568 Recall : 0.971067&nbsp; __label__汽车</div>
<div>
				F1-Score : 0.910314 Precision : 0.914414 Recall : 0.906250&nbsp; __label__时尚</div>
<div>
				F1-Score : 0.899281 Precision : 0.903614 Recall : 0.894988&nbsp; __label__健康</div>
<div>
				F1-Score : 0.929919 Precision : 0.905512 Recall : 0.955679&nbsp; __label__美食</div>
<div>
				F1-Score : 0.908136 Precision : 0.894057 Recall : 0.922667&nbsp; __label__军事</div>
<div>
				F1-Score : 0.967391 Precision : 0.975342 Recall : 0.959569&nbsp; __label__体育</div>
<div>
				F1-Score : 0.907618 Precision : 0.915033 Recall : 0.900322&nbsp; __label__育儿</div>
<div>
				F1-Score : 0.782895 Precision : 0.760383 Recall : 0.806780&nbsp; __label__情感</div>
<div>
				F1-Score : 0.863946 Precision : 0.866894 Recall : 0.861017&nbsp; __label__财经</div>
<div>
				F1-Score : 0.905188 Precision : 0.920000 Recall : 0.890845&nbsp; __label__教育</div>
<div>
				F1-Score : 0.781431 Precision : 0.792157 Recall : 0.770992&nbsp; __label__文化</div>
<div>
				F1-Score : 0.892495 Precision : 0.894309 Recall : 0.890688&nbsp; __label__游戏</div>
<div>
				F1-Score : 0.830882 Precision : 0.801418 Recall : 0.862595&nbsp; __label__科技</div>
<div>
				F1-Score : 0.795455 Precision : 0.781250 Recall : 0.810185&nbsp; __label__旅游</div>
<div>
				F1-Score : 0.843537 Precision : 0.826667 Recall : 0.861111&nbsp; __label__动漫</div>
<div>
				F1-Score : 0.960961 Precision : 0.969697 Recall : 0.952381&nbsp; __label__占卜</div>
<div>
				F1-Score : 0.915361 Precision : 0.912500 Recall : 0.918239&nbsp; __label__数码</div>
<div>
				F1-Score : 0.553191 Precision : 0.601852 Recall : 0.511811&nbsp; __label__搞笑</div>
<div>
				F1-Score : 0.788104 Precision : 0.834646 Recall : 0.746479&nbsp; __label__农林牧副渔</div>
<div>
				F1-Score : 0.797048 Precision : 0.830769 Recall : 0.765957&nbsp; __label__科学</div>
<div>
				F1-Score : 0.788462 Precision : 0.828283 Recall : 0.752294&nbsp; __label__家居</div>
<div>
				F1-Score : 0.831579 Precision : 0.877778 Recall : 0.790000&nbsp; __label__房产</div>
<div>
				F1-Score : 0.674286 Precision : 0.710843 Recall : 0.641304&nbsp; __label__生活方式</div>
<div>
				F1-Score : 0.908108 Precision : 0.933333 Recall : 0.884211&nbsp; __label__宠物</div>
<div>
				F1-Score : 0.546667 Precision : 0.546667 Recall : 0.546667&nbsp; __label__宗教</div>
<div>
				F1-Score : 0.706767 Precision : 0.671429 Recall : 0.746032&nbsp; __label__职场</div>
<div>
				F1-Score : 0.951220 Precision : 0.928571 Recall : 0.975000&nbsp; __label__天气</div>
<div>
				F1-Score : 0.666667 Precision : 0.909091 Recall : 0.526316&nbsp; __label__摄影</div>
<div>
				F1-Score : 0.707692 Precision : 0.718750 Recall : 0.696970&nbsp; __label__法律</div>
<div>
				F1-Score : 0.750000 Precision : 1.000000 Recall : 0.600000&nbsp; __label__彩票</div>
<div>
				F1-Score : 0.333333 Precision : 1.000000 Recall : 0.200000&nbsp; __label__移民</div>
<div>
				F1-Score : 0.000000 Precision : -------- Recall : 0.000000&nbsp; __label__生活百科</div>
<div>
				N<span style="white-space:pre"> </span>10703</div>
<div>
				P@1<span style="white-space:pre"> </span>0.870</div>
<div>
				R@1<span style="white-space:pre"> </span>0.870</div>
</blockquote>
<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="background-color: rgb(255, 255, 0);">✓</span>&nbsp;预测一段文本的label</p>
<pre style="background-color:#2b2b2b;color:#a9b7c6;font-family:'JetBrains Mono',monospace;font-size:12.0pt;">
<span style="color:#808080;">// </span><span style="color:#808080;font-family:'DejaVu Sans Mono',monospace;">预测一个分好词的</span><span style="color:#808080;">string</span><span style="color:#808080;font-family:'DejaVu Sans Mono',monospace;">的</span><span style="color:#808080;">label
</span>List&lt;ScoreLabelPair&gt; result = model.predict(Arrays.<span style="font-style:italic;">asList</span>(<span style="color:#6a8759;">&quot;</span><span style="color:#6a8759;font-family:'DejaVu Sans Mono',monospace;">人民网 辽宁 频道 人民网 沈阳 月</span><span style="color:#6a8759;"> 10 </span><span style="color:#6a8759;font-family:'DejaVu Sans Mono',monospace;">日电 日前 进一步 增强 全民 节能 意识</span><span style="color:#6a8759;">&quot;</span>.split(<span style="color:#6a8759;">&quot; &quot;</span>))<span style="color:#cc7832;">, </span><span style="color:#6897bb;">1</span><span style="color:#cc7832;">, </span><span style="color:#6897bb;">0</span>)<span style="color:#cc7832;">;
</span>System.<span style="color:#9876aa;font-style:italic;">out</span>.println(result.get(<span style="color:#6897bb;">0</span>).getLabel())<span style="color:#cc7832;">;</span></pre>
<p>		输出：</p>
<blockquote>
<p>
				__label__社会</p>
</blockquote>
<p>		注意这里的文本应该是分好词的、空格分隔的、清洗过的文本。<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="background-color: rgb(255, 255, 0);">✓</span>&nbsp;压缩模型<br />
		如果一个模型文件体积太大，可能放不进 distributed cache 中，所以压缩模型体积这个功能很有用。以我的模型为例，接近900MB的大小，压缩之后会变成 100 多MB，模型的Precision &amp; Recall指标却没有变差多少，值。</p>
<pre style="background-color:#2b2b2b;color:#a9b7c6;font-family:'JetBrains Mono',monospace;font-size:12.0pt;">
<span style="color:#808080;">// </span><span style="color:#808080;font-family:'DejaVu Sans Mono',monospace;">压缩模型并保存。加载压缩过的模型可以节省内存
</span>FastText qmodel = model.quantize(<span style="color:#6897bb;">2</span><span style="color:#cc7832;">, false, false</span>)<span style="color:#cc7832;">;
</span>qmodel.saveModelToSingleFile(<span style="color:#cc7832;">new </span>File(<span style="color:#6a8759;">&quot;/home/codelast/model_compressed&quot;</span>))<span style="color:#cc7832;">;</span></pre>
<p>		保存成压缩过的模型是一次性的操作，以后再加载模型的话，就加载这个压缩过的模型了。</p>
<p>		<span style="background-color: rgb(255, 255, 0);">✓</span>&nbsp;后记<br />
		通过 FastText4j 在&nbsp;Map-Reduce job 中并行做文本分类，成功地让文本分类任务提高了无数倍的速度，达到了实用的水平。</div>
</div>
<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-%e4%bd%bf%e7%94%a8-fasttext-%e5%81%9a%e4%b8%ad%e6%96%87%e6%96%87%e6%9c%ac%e5%88%86%e7%b1%bb5/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[原创] 使用 fastText 做中文文本分类(4)</title>
		<link>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e4%bd%bf%e7%94%a8-fasttext-%e5%81%9a%e4%b8%ad%e6%96%87%e6%96%87%e6%9c%ac%e5%88%86%e7%b1%bb4/</link>
					<comments>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e4%bd%bf%e7%94%a8-fasttext-%e5%81%9a%e4%b8%ad%e6%96%87%e6%96%87%e6%9c%ac%e5%88%86%e7%b1%bb4/#respond</comments>
		
		<dc:creator><![CDATA[learnhard]]></dc:creator>
		<pubDate>Wed, 29 Jul 2020 09:47:42 +0000</pubDate>
				<category><![CDATA[Algorithm]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[fastText]]></category>
		<category><![CDATA[中文]]></category>
		<category><![CDATA[文本分类]]></category>
		<guid isPermaLink="false">https://www.codelast.com/?p=12827</guid>

					<description><![CDATA[<p>查看本系列文章合集，请看<a href="https://www.codelast.com/?p=12856" rel="noopener noreferrer" target="_blank"><span style="background-color: rgb(255, 160, 122);">这里</span></a>。</p>
<p><span style="background-color: rgb(255, 255, 0);">✓</span>&#160;开始训练第一个文本分类模型<br />
标注好的数据，其格式为：</p>
<blockquote>
<p>
		__label__科技 月 10 日 网通 社从 高合 汽车 获悉 华人 运通 微软 2020 世界 人工智能 大会 云端 峰会 WAIC 2020 上 达成 战略 合作 依托 微软 小冰 人工智能 技术 高合 汽车 上 落地 全球 首个 主动式 人工智能 伙伴 HiPhiGo 用户 提供 更好 交通 出行 体验 人工智能 交通 行业 创新 融合 发展 探讨 成立 联合 智能 计算 实验室 智能 汽车 载体 智捷 交通 多个 领域 展开 深度 合作 人工智能 前瞻 技术 研发 推动 智慧 出行 社会 持续 发展 微软 亚洲 互联网 工程院 院长 王永东 微软 华人 运通 合作 使 人工智能 技术 切实可行 落地 场景 得以 转化 真实有效 生产力 发挥 更大 价值 微软 华人 运通 携手 推进 人工智能 新兴 科技 汽车 智慧 智慧 出行 领域 广泛应用 产业 升级 社会 持续 发展 注入 新 活力 华人 运通 董事长 丁磊 此次 合作 顶级 人工智能 企业 智能 汽车 公司 强强 联手 AI 多项 领先 技术 全球 汽车行业 首次 量产 落地 世界 内 技术 领先 性 首款 智能 汽车 高合 HiPhi 有条不紊 推进 全球 首条 车路 协同 自动 驾驶 智能化 城市道路 示范 项目 盐城 开通 试运行 再 全球 首个 车路 城 一体化 5G 无人驾驶 交通 运营 样板 上海 张江 未来 公园 成功 落地 华人 运通 以人为本 人性化 需求 出发 人性化 智慧 打造 智能 汽车 智捷 交通 智慧 城市 三智 战略 各项 业务 稳步 推进 高合 首款 量产 车 HiPhi 2020 年底 小批量 试生产 2021 年 上市 交付</p>
</blockquote>
<p>按 fastText 的<a href="https://fasttext.cc/docs/en/supervised-tutorial.html" rel="noopener noreferrer" target="_blank"><span style="background-color:#fff0f5;">指南</span></a>，把这份数据按大概 9:1 的比例，分成training集和validation集，然后开始训练模型：</p>
<blockquote>
<p>
		./fasttext</p></blockquote>&#8230; <a href="https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e4%bd%bf%e7%94%a8-fasttext-%e5%81%9a%e4%b8%ad%e6%96%87%e6%96%87%e6%9c%ac%e5%88%86%e7%b1%bb4/" class="read-more">Read More </a>]]></description>
										<content:encoded><![CDATA[<p>查看本系列文章合集，请看<a href="https://www.codelast.com/?p=12856" rel="noopener noreferrer" target="_blank"><span style="background-color: rgb(255, 160, 122);">这里</span></a>。</p>
<p><span style="background-color: rgb(255, 255, 0);">✓</span>&nbsp;开始训练第一个文本分类模型<br />
标注好的数据，其格式为：</p>
<blockquote>
<p>
		__label__科技 月 10 日 网通 社从 高合 汽车 获悉 华人 运通 微软 2020 世界 人工智能 大会 云端 峰会 WAIC 2020 上 达成 战略 合作 依托 微软 小冰 人工智能 技术 高合 汽车 上 落地 全球 首个 主动式 人工智能 伙伴 HiPhiGo 用户 提供 更好 交通 出行 体验 人工智能 交通 行业 创新 融合 发展 探讨 成立 联合 智能 计算 实验室 智能 汽车 载体 智捷 交通 多个 领域 展开 深度 合作 人工智能 前瞻 技术 研发 推动 智慧 出行 社会 持续 发展 微软 亚洲 互联网 工程院 院长 王永东 微软 华人 运通 合作 使 人工智能 技术 切实可行 落地 场景 得以 转化 真实有效 生产力 发挥 更大 价值 微软 华人 运通 携手 推进 人工智能 新兴 科技 汽车 智慧 智慧 出行 领域 广泛应用 产业 升级 社会 持续 发展 注入 新 活力 华人 运通 董事长 丁磊 此次 合作 顶级 人工智能 企业 智能 汽车 公司 强强 联手 AI 多项 领先 技术 全球 汽车行业 首次 量产 落地 世界 内 技术 领先 性 首款 智能 汽车 高合 HiPhi 有条不紊 推进 全球 首条 车路 协同 自动 驾驶 智能化 城市道路 示范 项目 盐城 开通 试运行 再 全球 首个 车路 城 一体化 5G 无人驾驶 交通 运营 样板 上海 张江 未来 公园 成功 落地 华人 运通 以人为本 人性化 需求 出发 人性化 智慧 打造 智能 汽车 智捷 交通 智慧 城市 三智 战略 各项 业务 稳步 推进 高合 首款 量产 车 HiPhi 2020 年底 小批量 试生产 2021 年 上市 交付</p>
</blockquote>
<p>按 fastText 的<a href="https://fasttext.cc/docs/en/supervised-tutorial.html" rel="noopener noreferrer" target="_blank"><span style="background-color:#fff0f5;">指南</span></a>，把这份数据按大概 9:1 的比例，分成training集和validation集，然后开始训练模型：</p>
<blockquote>
<p>
		./fasttext supervised -input labeled-data_train -output model</p>
</blockquote>
<p>其中，labeled-data_train 是training集文件，model 是输出模型的文件名前缀。<br />
经过一段时间的等待（速度很快），当前目录下就生成了模型文件：<span style="color:#0000ff;">model.bin</span> 和 <span style="color:#0000ff;">model.vec</span>。<br />
<span id="more-12827"></span><br />
现在可以用validation集来检验一下模型效果了：</p>
<blockquote>
<p>
		./fasttext test model.bin labeled-data_valid 1</p>
</blockquote>
<p>其中，labeled-data_valid 是validation集文件，1表示只预测top 1的label。<br />
输出：</p>
<blockquote>
<div>
		N<span style="white-space:pre"> </span>10705</div>
<div>
		P@1<span style="white-space:pre"> </span>0.842</div>
<div>
		R@1<span style="white-space:pre"> </span>0.842</div>
</blockquote>
<div>
	即 <span style="color:#0000ff;">Precision</span>为0.842，<span style="color:#0000ff;">Recall</span>为0.842。这个结果还可以，但还能优化。<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="background-color: rgb(255, 255, 0);">✓</span>&nbsp;模型调优<br />
	设置更详细的参数重新训练模型：</div>
<blockquote>
<div>
		./fasttext supervised -input labeled-data_train -output model -lr 1.0 -epoch 25 -wordNgrams 2</div>
</blockquote>
<div>
	其中：<br />
	-lr 1.0 表示 learning rate 设置成 1.0（通常值：0.1 ～ 1.0）。<br />
	-epoch 25 表示迭代的轮数设置成 25。<br />
	-wordNgrams 2 表示n-gram的值，一般使用2，表示2-gram。<br />
	这样训练出来的模型，再做一次test，结果变好了一些：</p>
<blockquote>
<div>
			N<span style="white-space:pre"> </span>10705</div>
<div>
			P@1<span style="white-space:pre"> </span>0.878</div>
<div>
			R@1<span style="white-space:pre"> </span>0.878</div>
</blockquote>
<div>
		这里只对模型优化做了简单的尝试。</p>
<p>		<span style="background-color: rgb(255, 255, 0);">✓</span>&nbsp;交互模式下预测文本的分类<br />
		执行以下命令：</p>
<blockquote>
<p>
				./fasttext predict model.bin -</p>
</blockquote>
<p>		fastText会加载 model.bin 模型，进入交互模式，等待用户输入。<br />
		此时输入的应该是分好词之后的文本，例如&ldquo;网通 社从 高合 汽车 获悉 华人 运通 微软 2020 世界 人工智能 大会 云端 峰会 WAIC 2020 上 达成 战略 合作&rdquo;。一回车，fastText马上会返回该段文本的预测分类：</p>
<blockquote>
<p>
				__label__科技</p>
</blockquote>
<p>		这是个比较方便的调试方法。</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>
</p></div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e4%bd%bf%e7%94%a8-fasttext-%e5%81%9a%e4%b8%ad%e6%96%87%e6%96%87%e6%9c%ac%e5%88%86%e7%b1%bb4/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[原创] 使用 fastText 做中文文本分类(3)</title>
		<link>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e4%bd%bf%e7%94%a8-fasttext-%e5%81%9a%e4%b8%ad%e6%96%87%e6%96%87%e6%9c%ac%e5%88%86%e7%b1%bb3/</link>
					<comments>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e4%bd%bf%e7%94%a8-fasttext-%e5%81%9a%e4%b8%ad%e6%96%87%e6%96%87%e6%9c%ac%e5%88%86%e7%b1%bb3/#respond</comments>
		
		<dc:creator><![CDATA[learnhard]]></dc:creator>
		<pubDate>Wed, 29 Jul 2020 09:47:20 +0000</pubDate>
				<category><![CDATA[Algorithm]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[fastText]]></category>
		<category><![CDATA[中文]]></category>
		<category><![CDATA[文本分类]]></category>
		<category><![CDATA[腾讯云]]></category>
		<guid isPermaLink="false">https://www.codelast.com/?p=12796</guid>

					<description><![CDATA[<p>查看本系列文章合集，请看<a href="https://www.codelast.com/?p=12856" rel="noopener noreferrer" target="_blank"><span style="background-color: rgb(255, 160, 122);">这里</span></a>。</p>
<p>为 training 数据做标注，这可能是一个艰巨的任务，也可能是一个有捷径的任务。<br />
有时候，我们可以依据一些已知的规则来标注文本，比如不同的数据是从不同的来源获取到的，从来源可以知道它们所属的类别，这是一个捷径。不过我这里不具备这样的条件。<br />
我的数据来源是网上的各种新闻，不是某些专业领域的数据，这种比较常见的文本分类任务，可以利用国内的几大云服务商提供的免费接口来完成。阿里云、腾讯云都有这样的接口。<br />
以腾讯云为例，其&#8220;人工智能&#8594;<a href="https://cloud.tencent.com/product/nlp" rel="noopener noreferrer" target="_blank"><span style="background-color:#fff0f5;">自然语言处理</span></a>&#8221;产品提供了文本分类功能：</p>
<blockquote>
<div>
		文本分类接口能够对用户输入的文本进行自动分类，将其映射到具体的类目上，用户只需要提供待分类的文本，而无需关注具体实现。</div>
<div>
		该功能基于千亿级大规模互联网语料和LSTM、BERT等深度神经网络模型进行训练，并持续迭代更新，以保证效果不断提升。</div>
<div>
		目前已提供：</div>
<div>
		● 通用领域分类体系，包括15个分类类目，分别是汽车、科技、健康、体育、旅行、教育、职业、文化、军事、房产、娱乐、女性、奥运、财经以及其他，适用于通用的场景。</div>
<div>
		● 新闻领域分类体系，包括37个一级分类类目，285个二级分类（详细请见 类目体系映射表），已应用于腾讯新闻的文章分类。</div>
<div>
		更多垂直领域的分类体系即将推出，敬请期待。</div>
<div>
		默认接口请求频率限制：20次/秒。</div>
</blockquote>
<div>
	该API每天有50万次免费调用额度，用来标注数据够用了：<br />
	<a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><img decoding="async" alt="tencent cloud nlp free resource" src="https://www.codelast.com/wp-content/uploads/2020/07/tencent_nlp_free_resource.png" style="width: 375px; height: 81px;" /></a><br />
	如果你对这个接口的分类结果准确性有疑虑的话，可以亲自拿一些新闻的文本试一试，就会发现它的效果真的不错，完全可以用来当作人工标注的结果了，毕竟是大厂出品嘛。<br />
	<span id="more-12796"></span><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 />
	下面，就来看看怎么薅腾讯云的羊毛。注册腾讯云账号、开通自然语言处理接口的权限，这些就不用说了，自己在网页上点几下就可以完成。<br />
	<span style="background-color: rgb(255, 255, 0);">✓</span>&#160;测试接口<br />
	腾讯云NLP接口提供了一个在线测试的网页，从<a href="https://cloud.tencent.com/document/product/271/35496" rel="noopener noreferrer" target="_blank"><span style="background-color:#fff0f5;">这个</span></a>链接可以进去（&#8220;<span style="color:#0000ff;">点击调试</span>&#8221;）：</div>
<p><img decoding="async" alt="tencent cloud nlp debug entrance" src="https://www.codelast.com/wp-content/uploads/2020/07/tencent_nlp_debug_entrance.png" style="width: 700px; height: 137px;" /></p>
<p><span style="color:#0000ff;">进入调试页面：</span><br />
<a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><img decoding="async" alt="" src="https://www.codelast.com/wp-content/uploads/2020/07/tencent_nlp_web_debug.png" style="width: 700px; height: 413px;" /></a><br />
对这个接口：<br />
Region只能选&#8220;华南地区(广州)&#8221;。<br />
Text是待分类的文本，注意<span style="color:#ff0000;">不需要分词</span>。只需要把我们前面清洗过（去掉了HTML tag等内容）的句子拿来用即可。<br />
Flag为&#160;1 表示通用领域，为 2 表示新闻领域。<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>&#8230; <a href="https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e4%bd%bf%e7%94%a8-fasttext-%e5%81%9a%e4%b8%ad%e6%96%87%e6%96%87%e6%9c%ac%e5%88%86%e7%b1%bb3/" class="read-more">Read More </a></p>]]></description>
										<content:encoded><![CDATA[<p>查看本系列文章合集，请看<a href="https://www.codelast.com/?p=12856" rel="noopener noreferrer" target="_blank"><span style="background-color: rgb(255, 160, 122);">这里</span></a>。</p>
<p>为 training 数据做标注，这可能是一个艰巨的任务，也可能是一个有捷径的任务。<br />
有时候，我们可以依据一些已知的规则来标注文本，比如不同的数据是从不同的来源获取到的，从来源可以知道它们所属的类别，这是一个捷径。不过我这里不具备这样的条件。<br />
我的数据来源是网上的各种新闻，不是某些专业领域的数据，这种比较常见的文本分类任务，可以利用国内的几大云服务商提供的免费接口来完成。阿里云、腾讯云都有这样的接口。<br />
以腾讯云为例，其&ldquo;人工智能&rarr;<a href="https://cloud.tencent.com/product/nlp" rel="noopener noreferrer" target="_blank"><span style="background-color:#fff0f5;">自然语言处理</span></a>&rdquo;产品提供了文本分类功能：</p>
<blockquote>
<div>
		文本分类接口能够对用户输入的文本进行自动分类，将其映射到具体的类目上，用户只需要提供待分类的文本，而无需关注具体实现。</div>
<div>
		该功能基于千亿级大规模互联网语料和LSTM、BERT等深度神经网络模型进行训练，并持续迭代更新，以保证效果不断提升。</div>
<div>
		目前已提供：</div>
<div>
		● 通用领域分类体系，包括15个分类类目，分别是汽车、科技、健康、体育、旅行、教育、职业、文化、军事、房产、娱乐、女性、奥运、财经以及其他，适用于通用的场景。</div>
<div>
		● 新闻领域分类体系，包括37个一级分类类目，285个二级分类（详细请见 类目体系映射表），已应用于腾讯新闻的文章分类。</div>
<div>
		更多垂直领域的分类体系即将推出，敬请期待。</div>
<div>
		默认接口请求频率限制：20次/秒。</div>
</blockquote>
<div>
	该API每天有50万次免费调用额度，用来标注数据够用了：<br />
	<a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><img decoding="async" alt="tencent cloud nlp free resource" src="https://www.codelast.com/wp-content/uploads/2020/07/tencent_nlp_free_resource.png" style="width: 375px; height: 81px;" /></a><br />
	如果你对这个接口的分类结果准确性有疑虑的话，可以亲自拿一些新闻的文本试一试，就会发现它的效果真的不错，完全可以用来当作人工标注的结果了，毕竟是大厂出品嘛。<br />
	<span id="more-12796"></span><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 />
	下面，就来看看怎么薅腾讯云的羊毛。注册腾讯云账号、开通自然语言处理接口的权限，这些就不用说了，自己在网页上点几下就可以完成。<br />
	<span style="background-color: rgb(255, 255, 0);">✓</span>&nbsp;测试接口<br />
	腾讯云NLP接口提供了一个在线测试的网页，从<a href="https://cloud.tencent.com/document/product/271/35496" rel="noopener noreferrer" target="_blank"><span style="background-color:#fff0f5;">这个</span></a>链接可以进去（&ldquo;<span style="color:#0000ff;">点击调试</span>&rdquo;）：</div>
<p><img decoding="async" alt="tencent cloud nlp debug entrance" src="https://www.codelast.com/wp-content/uploads/2020/07/tencent_nlp_debug_entrance.png" style="width: 700px; height: 137px;" /></p>
<p><span style="color:#0000ff;">进入调试页面：</span><br />
<a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><img decoding="async" alt="" src="https://www.codelast.com/wp-content/uploads/2020/07/tencent_nlp_web_debug.png" style="width: 700px; height: 413px;" /></a><br />
对这个接口：<br />
Region只能选&ldquo;华南地区(广州)&rdquo;。<br />
Text是待分类的文本，注意<span style="color:#ff0000;">不需要分词</span>。只需要把我们前面清洗过（去掉了HTML tag等内容）的句子拿来用即可。<br />
Flag为&nbsp;1 表示通用领域，为 2 表示新闻领域。<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 />
接口返回的数据是JSON格式，FirstClassName 是一级分类的名称，SecondClassName 是二级分类的名称。<br />
调试页面还提供了&ldquo;代码生成&rdquo;功能，Java、Python、PHP、Go等都有，支持非常全面。选一个你熟悉的语言，就可以在代码里实现了。</p>
<p>由于免费的接口的QPS上限为20次/秒，所以并行什么的就不要想了，单线程就能跑满。<br />
通过腾讯云的接口，我们能在半天内为几十万条文本打上标签，再整理成 fastText 规定的格式，就可以训练模型了。<br />
如果觉得50万条都不够多，可以注册多个腾讯云账号来薅羊毛，或者用几天的时间累积够标注数据。</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>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e4%bd%bf%e7%94%a8-fasttext-%e5%81%9a%e4%b8%ad%e6%96%87%e6%96%87%e6%9c%ac%e5%88%86%e7%b1%bb3/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[原创] 使用 fastText 做中文文本分类(2)</title>
		<link>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e4%bd%bf%e7%94%a8-fasttext-%e5%81%9a%e4%b8%ad%e6%96%87%e6%96%87%e6%9c%ac%e5%88%86%e7%b1%bb2/</link>
					<comments>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e4%bd%bf%e7%94%a8-fasttext-%e5%81%9a%e4%b8%ad%e6%96%87%e6%96%87%e6%9c%ac%e5%88%86%e7%b1%bb2/#respond</comments>
		
		<dc:creator><![CDATA[learnhard]]></dc:creator>
		<pubDate>Wed, 29 Jul 2020 09:46:54 +0000</pubDate>
				<category><![CDATA[Algorithm]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[fastText]]></category>
		<category><![CDATA[HanLP]]></category>
		<category><![CDATA[中文]]></category>
		<category><![CDATA[文本分类]]></category>
		<guid isPermaLink="false">https://www.codelast.com/?p=12777</guid>

					<description><![CDATA[<p>查看本系列文章合集，请看<a href="https://www.codelast.com/?p=12856" rel="noopener noreferrer" target="_blank"><span style="background-color: rgb(255, 160, 122);">这里</span></a>。</p>
<p>做好文本预处理，才能输入fastText训练一个效果好的模型出来。</p>
<p><span style="background-color: rgb(255, 255, 0);">✓</span>&#160;原文示例<br />
有时我们拿到的源数据是很粗糙的，带有很多会影响模型效果的内容，例如下面这样：</p>
<blockquote><p>
	&#60;p&#62;罗望子，是豆科酸豆属唯一的种，是热带乔木，原产于东部非洲，包括马达加斯加落叶森林，但已被引入热带亚洲、拉丁美洲和加勒比海。柽柳是中国海南省三亚的一种城市树木。罗望子最适合生长在温度高、日照长、气候干燥、干湿季节分明的地区。&#60;/p&#62;&#60;p&#62;&#60;img src=&#34;http://p0.qhimg.com/t014b83dc78c7cc5000.jpg?size=741x320&#34;/&#62;&#60;br /&#62;&#60;/p&#62;&#60;p&#62;罗望子富含糖、乙酸、酒石酸、甲酸、柠檬酸等成分，主要用于调味品、饮料、果酱等食品领域。吃一点罗望子有很多好处。当我们吃罗望子时，罗望子中含有的多糖是一种非常好的抗光物质。当我们吃这种物质时，它可以防止紫外线辐射伤害皮肤。通常吃一点罗望子，饭前吃一点罗望子可以增进食欲，改善我们的饮食质量。在炎热的夏日，吃一点罗望子可以生津止渴，清热解毒，降低中暑的风险。&#60;/p&#62;&#60;p&#62;&#60;img src=&#34;http://p1.qhimg.com/t01ecdbbc26c329a78b.jpg?size=533x409&#34;/&#62;&#60;br /&#62;&#60;/p&#62;&#60;p&#62;罗望子种子含有丰富的抗氧化物质。多吃罗望子籽可以延缓人体衰老，保持皮肤湿润有光泽。罗望子种子还含有一些清热解毒、消炎的物质，可以帮助我们的人体抵抗一些有害细菌，保护我们的健康。</p></blockquote>
<div>
	这里面不仅带有URL、大量的HTML标签，而且还有标点符号等，这些都要清洗掉。<br />
	<span id="more-12777"></span><br />
	<span style="background-color: rgb(255, 255, 0);">✓</span>&#160;清除掉HTML标签、URL<br />
	这里给出Java版的一个实现(从网上借鉴来的)，它们并不完善，但是够用了：
<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="java language-java 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;">&#160;&#160;&#160;&#160;<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;">/**
&#160;&#160;&#160;&#160;&#160;*&#160;移除一个字符串中的HTML标签。
&#160;&#160;&#160;&#160;&#160;*
&#160;&#160;&#160;&#160;&#160;*&#160;<span class="hljs-doctag" style="font-size: inherit; color: inherit; line-height: inherit; margin: 0px; padding: 0px; word-wrap: inherit !important; word-break: inherit !important;">@param</span>&#160;inputStr&#160;输入的字符串。
&#160;&#160;&#160;&#160;&#160;*&#160;<span class="hljs-doctag" style="font-size: inherit; color: inherit; line-height: inherit; margin: 0px; padding: 0px; word-wrap: inherit !important; word-break: inherit !important;">@return</span>&#160;移除了HTML标签之后的字符串。
&#160;&#160;&#160;&#160;&#160;*/</span>
&#160;&#160;&#160;&#160;<span class="hljs-function" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;"><span class="hljs-keyword" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; overflow-wrap: inherit !important; word-break: inherit !important;">private</span>&#160;String&#160;<span class="hljs-title" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(165, 218, 45); word-wrap: inherit !important; word-break: inherit !important;">removeHtmlTags</span><span class="hljs-params" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(255, 152, 35); word-wrap: inherit !important; word-break: inherit !important;">(String&#160;inputStr)</span>&#160;</span>{
&#160;&#160;&#160;&#160;&#160;&#160;<span class="hljs-keyword" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">if</span>&#160;(StringUtils.isEmpty(inputStr))&#160;{
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span class="hljs-keyword" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">return</span>&#160;inputStr;
&#160;&#160;&#160;&#160;&#160;&#160;}
&#160;&#160;&#160;&#160;&#160;&#160;<span class="hljs-keyword" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">return</span>&#160;inputStr.replaceAll(</code></pre></section></div>&#8230; <a href="https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e4%bd%bf%e7%94%a8-fasttext-%e5%81%9a%e4%b8%ad%e6%96%87%e6%96%87%e6%9c%ac%e5%88%86%e7%b1%bb2/" class="read-more">Read More </a>]]></description>
										<content:encoded><![CDATA[<p>查看本系列文章合集，请看<a href="https://www.codelast.com/?p=12856" rel="noopener noreferrer" target="_blank"><span style="background-color: rgb(255, 160, 122);">这里</span></a>。</p>
<p>做好文本预处理，才能输入fastText训练一个效果好的模型出来。</p>
<p><span style="background-color: rgb(255, 255, 0);">✓</span>&nbsp;原文示例<br />
有时我们拿到的源数据是很粗糙的，带有很多会影响模型效果的内容，例如下面这样：</p>
<blockquote><p>
	&lt;p&gt;罗望子，是豆科酸豆属唯一的种，是热带乔木，原产于东部非洲，包括马达加斯加落叶森林，但已被引入热带亚洲、拉丁美洲和加勒比海。柽柳是中国海南省三亚的一种城市树木。罗望子最适合生长在温度高、日照长、气候干燥、干湿季节分明的地区。&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;http://p0.qhimg.com/t014b83dc78c7cc5000.jpg?size=741x320&quot;/&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;罗望子富含糖、乙酸、酒石酸、甲酸、柠檬酸等成分，主要用于调味品、饮料、果酱等食品领域。吃一点罗望子有很多好处。当我们吃罗望子时，罗望子中含有的多糖是一种非常好的抗光物质。当我们吃这种物质时，它可以防止紫外线辐射伤害皮肤。通常吃一点罗望子，饭前吃一点罗望子可以增进食欲，改善我们的饮食质量。在炎热的夏日，吃一点罗望子可以生津止渴，清热解毒，降低中暑的风险。&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;http://p1.qhimg.com/t01ecdbbc26c329a78b.jpg?size=533x409&quot;/&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;罗望子种子含有丰富的抗氧化物质。多吃罗望子籽可以延缓人体衰老，保持皮肤湿润有光泽。罗望子种子还含有一些清热解毒、消炎的物质，可以帮助我们的人体抵抗一些有害细菌，保护我们的健康。</p></blockquote>
<div>
	这里面不仅带有URL、大量的HTML标签，而且还有标点符号等，这些都要清洗掉。<br />
	<span id="more-12777"></span><br />
	<span style="background-color: rgb(255, 255, 0);">✓</span>&nbsp;清除掉HTML标签、URL<br />
	这里给出Java版的一个实现(从网上借鉴来的)，它们并不完善，但是够用了：</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="java language-java 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;">&nbsp;&nbsp;&nbsp;&nbsp;<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;">/**
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;移除一个字符串中的HTML标签。
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;<span class="hljs-doctag" style="font-size: inherit; color: inherit; line-height: inherit; margin: 0px; padding: 0px; word-wrap: inherit !important; word-break: inherit !important;">@param</span>&nbsp;inputStr&nbsp;输入的字符串。
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;<span class="hljs-doctag" style="font-size: inherit; color: inherit; line-height: inherit; margin: 0px; padding: 0px; word-wrap: inherit !important; word-break: inherit !important;">@return</span>&nbsp;移除了HTML标签之后的字符串。
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="hljs-function" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;"><span class="hljs-keyword" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; overflow-wrap: inherit !important; word-break: inherit !important;">private</span>&nbsp;String&nbsp;<span class="hljs-title" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(165, 218, 45); word-wrap: inherit !important; word-break: inherit !important;">removeHtmlTags</span><span class="hljs-params" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(255, 152, 35); word-wrap: inherit !important; word-break: inherit !important;">(String&nbsp;inputStr)</span>&nbsp;</span>{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="hljs-keyword" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">if</span>&nbsp;(StringUtils.isEmpty(inputStr))&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="hljs-keyword" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">return</span>&nbsp;inputStr;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="hljs-keyword" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">return</span>&nbsp;inputStr.replaceAll(<span class="hljs-string" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(238, 220, 112); word-wrap: inherit !important; word-break: inherit !important;">&quot;&lt;[^&gt;]*&gt;&quot;</span>,&nbsp;<span class="hljs-string" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(238, 220, 112); word-wrap: inherit !important; word-break: inherit !important;">&quot;&quot;</span>);
&nbsp;&nbsp;&nbsp;&nbsp;}

&nbsp;&nbsp;&nbsp;&nbsp;<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;">/**
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;移除一个字符串中的URL。
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;<span class="hljs-doctag" style="font-size: inherit; color: inherit; line-height: inherit; margin: 0px; padding: 0px; word-wrap: inherit !important; word-break: inherit !important;">@param</span>&nbsp;inputStr&nbsp;输入的字符串。
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;<span class="hljs-doctag" style="font-size: inherit; color: inherit; line-height: inherit; margin: 0px; padding: 0px; word-wrap: inherit !important; word-break: inherit !important;">@return</span>&nbsp;移除了URL之后的字符串。
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="hljs-function" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;"><span class="hljs-keyword" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; overflow-wrap: inherit !important; word-break: inherit !important;">private</span>&nbsp;String&nbsp;<span class="hljs-title" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(165, 218, 45); word-wrap: inherit !important; word-break: inherit !important;">removeUrl</span><span class="hljs-params" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(255, 152, 35); word-wrap: inherit !important; word-break: inherit !important;">(String&nbsp;inputStr)</span>&nbsp;</span>{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;urlPattern&nbsp;=&nbsp;<span class="hljs-string" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(238, 220, 112); word-wrap: inherit !important; word-break: inherit !important;">&quot;((https?|ftp|gopher|telnet|file|Unsure|http):((//)|(\\\$$)+[\\w\\d:#@%/;$()~_?+-=\\\\.&amp;]*)&quot;</span>;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Pattern&nbsp;p&nbsp;=&nbsp;Pattern.compile(urlPattern,&nbsp;Pattern.CASE_INSENSITIVE);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Matcher&nbsp;m&nbsp;=&nbsp;p.matcher(inputStr);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;StringBuffer&nbsp;sb&nbsp;=&nbsp;<span class="hljs-keyword" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">new</span>&nbsp;StringBuffer(inputStr.length());
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="hljs-keyword" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">while</span>&nbsp;(m.find())&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m.appendReplacement(sb,&nbsp;<span class="hljs-string" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(238, 220, 112); word-wrap: inherit !important; word-break: inherit !important;">&quot;&quot;</span>);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="hljs-keyword" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">return</span>&nbsp;sb.length()&nbsp;==&nbsp;<span class="hljs-number" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(174, 135, 250); word-wrap: inherit !important; word-break: inherit !important;">0</span>&nbsp;?&nbsp;inputStr&nbsp;:&nbsp;sb.toString();
&nbsp;&nbsp;&nbsp;&nbsp;}
</code></pre>
</section>
<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 />
	以前面的内容为例，依次经过上面两个方法处理后，得到的结果是：</div>
<blockquote>
<div>
		罗望子，是豆科酸豆属唯一的种，是热带乔木，原产于东部非洲，包括马达加斯加落叶森林，但已被引入热带亚洲、拉丁美洲和加勒比海。柽柳是中国海南省三亚的一种城市树木。罗望子最适合生长在温度高、日照长、气候干燥、干湿季节分明的地区。罗望子富含糖、乙酸、酒石酸、甲酸、柠檬酸等成分，主要用于调味品、饮料、果酱等食品领域。吃一点罗望子有很多好处。当我们吃罗望子时，罗望子中含有的多糖是一种非常好的抗光物质。当我们吃这种物质时，它可以防止紫外线辐射伤害皮肤。通常吃一点罗望子，饭前吃一点罗望子可以增进食欲，改善我们的饮食质量。在炎热的夏日，吃一点罗望子可以生津止渴，清热解毒，降低中暑的风险。罗望子种子含有丰富的抗氧化物质。多吃罗望子籽可以延缓人体衰老，保持皮肤湿润有光泽。罗望子种子还含有一些清热解毒、消炎的物质，可以帮助我们的人体抵抗一些有害细菌，保护我们的健康。</div>
</blockquote>
<div>
	这样看上去就干净多了。<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 />
	除此之外，还有标点符号，以及一些无用的词需要被除掉，这些词对表达文本的主要含义作用不大，比如&ldquo;啊&rdquo;，&ldquo;嘿&rdquo;之类的词，它们一般称为<span style="color:#0000ff;">停用词</span>(stop words)。我们可以从网上下载到常用的停用词表，比如<a href="https://github.com/goto456/stopwords" rel="noopener noreferrer" target="_blank"><span style="background-color:#fff0f5;">这个</span></a>链接。<br />
	在对文本进行分词之后，出现在停用词表中的，全都过滤掉。</p>
<p>	<span style="background-color: rgb(255, 255, 0);">✓</span>&nbsp;分词并去除停用词<br />
	Python下比较流行的中文分词器之一是<a href="https://github.com/fxsjy/jieba" rel="noopener noreferrer" target="_blank"><span style="background-color:#fff0f5;">结巴分词</span></a>：</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="python language-python 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;"><span class="hljs-keyword" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">import</span>&nbsp;jieba


my_text&nbsp;=&nbsp;<span class="hljs-string" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(238, 220, 112); word-wrap: inherit !important; word-break: inherit !important;">&#39;罗望子，是豆科酸豆属唯一的种，...&#39;

</span>

<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;">#&nbsp;分词</span>
segmented_words&nbsp;=&nbsp;jieba.cut(my_text,&nbsp;cut_all=<span class="hljs-keyword" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">False</span>)&nbsp;&nbsp;<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;">#&nbsp;精确分词模式

</span>

<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;">#&nbsp;去除停用词
</span>
<span class="hljs-keyword" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">for</span>&nbsp;single_word&nbsp;<span class="hljs-keyword" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">in</span>&nbsp;segmented_words:
&nbsp;&nbsp;&nbsp;&nbsp;<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 class="hljs-doctag" style="font-size: inherit; color: inherit; line-height: inherit; margin: 0px; padding: 0px; word-wrap: inherit !important; word-break: inherit !important;">TODO:</span>&nbsp;去除停用词</span></code></pre>
</section>
<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 />
	Java版的结巴分词作者已经不维护了，建议换其他的分词器，比如用户量很大的<a href="https://github.com/hankcs/HanLP" rel="noopener noreferrer" target="_blank"><span style="background-color:#fff0f5;">HanLP</span></a>。其使用也非常简单，在Maven项目的 pom.xml&nbsp;中添加：</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="xml language-xml 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;">&nbsp;&nbsp;&nbsp;&nbsp;<span class="hljs-tag" style="font-size: inherit; color: inherit; line-height: inherit; margin: 0px; padding: 0px; word-wrap: inherit !important; word-break: inherit !important;">&lt;<span class="hljs-name" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">dependency</span>&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="hljs-tag" style="font-size: inherit; color: inherit; line-height: inherit; margin: 0px; padding: 0px; word-wrap: inherit !important; word-break: inherit !important;">&lt;<span class="hljs-name" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">groupId</span>&gt;</span>com.hankcs<span class="hljs-tag" style="font-size: inherit; color: inherit; line-height: inherit; margin: 0px; padding: 0px; word-wrap: inherit !important; word-break: inherit !important;">&lt;/<span class="hljs-name" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">groupId</span>&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="hljs-tag" style="font-size: inherit; color: inherit; line-height: inherit; margin: 0px; padding: 0px; word-wrap: inherit !important; word-break: inherit !important;">&lt;<span class="hljs-name" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">artifactId</span>&gt;</span>hanlp<span class="hljs-tag" style="font-size: inherit; color: inherit; line-height: inherit; margin: 0px; padding: 0px; word-wrap: inherit !important; word-break: inherit !important;">&lt;/<span class="hljs-name" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">artifactId</span>&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="hljs-tag" style="font-size: inherit; color: inherit; line-height: inherit; margin: 0px; padding: 0px; word-wrap: inherit !important; word-break: inherit !important;">&lt;<span class="hljs-name" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">version</span>&gt;</span>portable-1.7.8<span class="hljs-tag" style="font-size: inherit; color: inherit; line-height: inherit; margin: 0px; padding: 0px; word-wrap: inherit !important; word-break: inherit !important;">&lt;/<span class="hljs-name" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">version</span>&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="hljs-tag" style="font-size: inherit; color: inherit; line-height: inherit; margin: 0px; padding: 0px; word-wrap: inherit !important; word-break: inherit !important;">&lt;/<span class="hljs-name" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">dependency</span>&gt;</span></code></pre>
</section>
<p>就可以用了：</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="java language-java 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;"><span class="hljs-keyword" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">import</span>&nbsp;com.hankcs.hanlp.seg.common.Term;
<span class="hljs-keyword" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">import</span>&nbsp;com.hankcs.hanlp.tokenizer.StandardTokenizer;

String&nbsp;myText&nbsp;=&nbsp;<span class="hljs-string" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(238, 220, 112); word-wrap: inherit !important; word-break: inherit !important;">&quot;罗望子，是豆科酸豆属唯一的种，...&quot;</span>;

List&lt;Term&gt;&nbsp;termList&nbsp;=&nbsp;StandardTokenizer.segment(myText);
<span class="hljs-keyword" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">for</span>&nbsp;(Term&nbsp;term&nbsp;:&nbsp;termList)&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(term.word);&nbsp;&nbsp;<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;">//&nbsp;term.word即分出来的每个词</span>
&nbsp;&nbsp;&nbsp;&nbsp;<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 class="hljs-doctag" style="font-size: inherit; color: inherit; line-height: inherit; margin: 0px; padding: 0px; word-wrap: inherit !important; word-break: inherit !important;">TODO:</span>&nbsp;去除停用词</span>
}
</code></pre>
</section>
<p>现在得到的是分好的词，并且把停用词等杂七杂八的东西都去掉了，也许对某些情况很糟糕的文本，还会有漏网之鱼，但对一般情况来说基本上够用了。<br />
	不同的分词器分出来的词结果不尽相同，这里以Java版为例，得到：</div>
<blockquote>
<div>
		罗 望子 豆科 酸 豆 属 唯一 种 热带 乔木 原产 东部 非洲 包括 马达加斯加 落 叶森林 已 引入 热带 亚洲 拉丁美洲 加勒比海 柽 柳是 中国 海南省 三亚 种 城市 树木 罗 望子 最 适合 生长 温度 高 日照 长 气候 干燥 干湿 季节 分明 地区 罗 望子 富含 糖 乙酸 酒石酸 甲酸 柠檬酸 成分 用于 调味品 饮料 果酱 食品 领域 吃 一点 罗 望子 很多 好处 吃 罗 望子 时 罗 望子 中 含有 多糖 种 好 抗光 物质 吃 物质 时 紫外线 辐射 伤害 皮肤 吃 一点 罗 望子 饭前 吃 一点 罗 望子 增进 食欲 改善 饮食 质量 炎热 夏日 吃 一点 罗 望子 生津止渴 清热 解毒 降低 中暑 风险 罗 望子 种子 含有 抗氧化 物质 吃 罗 望子 籽 延缓 人体 衰老 皮肤 湿润 光泽 罗 望子 种子 还 含有 清热 解毒 消炎 物质 人体 抵抗 有害 细菌 保护 健康</div>
</blockquote>
<div>
	为了清晰展示结果，词与词之间用空格隔开了。<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="background-color: rgb(255, 255, 0);">✓</span>&nbsp;文本标注<br />
	fastText对训练数据的格式要求是这样的：</p>
<blockquote>
<p>
			<span style="color:#0000ff;">__label__健康</span> 罗 望子 豆科 酸 豆 属 唯一 种 热带 乔木 原产 东部 非洲 包括 马达加斯加 落 叶森林 已 引入 热带 亚洲 拉丁美洲 加勒比海 柽 柳是 中国 海南省 三亚 种 城市 树木 罗 望子 最 适合 生长 温度 高 日照 长 气候 干燥 干湿 季节 分明 地区 罗 望子 富含 糖 乙酸 酒石酸 甲酸 柠檬酸 成分 用于 调味品 饮料 果酱 食品 领域 吃 一点 罗 望子 很多 好处 吃 罗 望子 时 罗 望子 中 含有 多糖 种 好 抗光 物质 吃 物质 时 紫外线 辐射 伤害 皮肤 吃 一点 罗 望子 饭前 吃 一点 罗 望子 增进 食欲 改善 饮食 质量 炎热 夏日 吃 一点 罗 望子 生津止渴 清热 解毒 降低 中暑 风险 罗 望子 种子 含有 抗氧化 物质 吃 罗 望子 籽 延缓 人体 衰老 皮肤 湿润 光泽 罗 望子 种子 还 含有 清热 解毒 消炎 物质 人体 抵抗 有害 细菌 保护 健康</p>
</blockquote>
<p>	每两个字符串之间都用空格隔开，以&ldquo;<span style="color:#0000ff;">__label__</span>&rdquo;开头的（前后均为双下划线）是后面文本的标签，这里可以有多个标签，比如&ldquo;__label__健康 __label__生活&rdquo;，也是用空格分隔开。前面说过，本文以1个标签举例，所以这里只有1个。<br />
	这是文本预处理的最后一步，完成之后就可以把数据喂给fastText训练出一个模型啦。<br />
	比如说上面分好词的文本，我们要为它标注一个类别（例如&ldquo;健康&rdquo;）。<br />
	然鹅，我们难道用人工肉眼看的方法来标注吗？并且，类别有哪些，我怎么知道？<br />
	就算有一目十行的能力，看瞎我的钛合金狗眼，我一天也标不了10万条数据啊！<br />
	欲知解决方法，请看下一篇文章。</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>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e4%bd%bf%e7%94%a8-fasttext-%e5%81%9a%e4%b8%ad%e6%96%87%e6%96%87%e6%9c%ac%e5%88%86%e7%b1%bb2/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[原创] 使用 fastText 做中文文本分类(1)</title>
		<link>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e4%bd%bf%e7%94%a8-fasttext-%e5%81%9a%e4%b8%ad%e6%96%87%e6%96%87%e6%9c%ac%e5%88%86%e7%b1%bb1/</link>
					<comments>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e4%bd%bf%e7%94%a8-fasttext-%e5%81%9a%e4%b8%ad%e6%96%87%e6%96%87%e6%9c%ac%e5%88%86%e7%b1%bb1/#respond</comments>
		
		<dc:creator><![CDATA[learnhard]]></dc:creator>
		<pubDate>Wed, 29 Jul 2020 09:46:10 +0000</pubDate>
				<category><![CDATA[Algorithm]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[fastText]]></category>
		<category><![CDATA[中文]]></category>
		<category><![CDATA[文本分类]]></category>
		<guid isPermaLink="false">https://www.codelast.com/?p=12754</guid>

					<description><![CDATA[<p>查看本系列文章合集，请看<a href="https://www.codelast.com/?p=12856" target="_blank" rel="noopener noreferrer"><span style="background-color:#ffa07a;">这里</span></a>。</p>
<p><span style="background-color: rgb(255, 255, 0);">✓</span>&#160;什么是&#8220;文本分类&#8221;</p>
<blockquote>
<p>
		它是图书馆学， 信息学和计算机科学中的一个问题。其任务是将一个文档分配到一个或者多个类别中。</p>
</blockquote>
<p>举例：</p>
<table selecttype="cells" style="border-collapse: collapse;">
<colgroup>
<col style="width: 550px;" width="550" />
<col style="width: 107px;" width="107" />
	</colgroup>
<tbody>
<tr height="24" style="height: 24px;">
<td style="empty-cells: show; line-height: normal; vertical-align: middle; outline-width: 0px; overflow-wrap: break-word; word-break: normal; white-space: nowrap; text-align: center; font-family: &#34;Microsoft YaHei&#34;; font-size: 10pt; background-color: rgb(223, 248, 255); border-width: 0.5pt; border-style: solid; border-color: rgb(0, 0, 0);">
				<font style="white-space: pre-wrap; font-size: 10pt;">文本</font></td>
<td style="empty-cells: show; line-height: normal; vertical-align: middle; outline-width: 0px; overflow-wrap: break-word; word-break: normal; white-space: nowrap; text-align: center; font-family: &#34;Microsoft YaHei&#34;; font-size: 10pt; background-color: rgb(223, 248, 255); border-width: 0.5pt; border-style: solid; border-color: rgb(0, 0, 0);">
				<font style="white-space: pre-wrap; font-size: 10pt;">类别</font></td>
</tr>
<tr height="24" style="height: 24px;">
<td style="empty-cells: show; line-height: normal; vertical-align: middle; outline-width: 0px; overflow-wrap: break-word; word-break: normal; font-family: &#34;Microsoft YaHei&#34;; font-size: 10pt; border-top: 0.5pt solid rgb(0, 0, 0); border-right: 0.5pt solid rgb(0, 0, 0); border-left: 0.5pt solid rgb(0, 0, 0);">
				<font style="white-space: pre-wrap; font-size: 10pt;">瑞幸咖啡今日发布声明称，瑞幸咖啡公司将于6月29日在纳斯达克停牌，并进行退市备案。声明表示，在国内消费市场方面，瑞幸咖啡全国4000多家门店将正常运营，近3万名员工仍将一如既往的为用户提供优质产品和服务。公司衷心感谢广大消费者的支持厚爱，并再次为事件造成的恶劣影响向社会各界诚挚道歉。</font></td>
<td style="empty-cells: show; line-height: normal; vertical-align: middle; outline-width: 0px; overflow-wrap: break-word; word-break: normal; white-space: nowrap; text-align: center; font-family: &#34;Microsoft YaHei&#34;; font-size: 10pt; border-top: 0.5pt solid rgb(0, 0, 0); border-right: 0.5pt solid rgb(0, 0, 0); border-left: 0.5pt solid rgb(0, 0, 0);">
				<font style="white-space: pre-wrap; font-size: 10pt;">财经</font></td>
</tr>
<tr height="24" style="height: 24px;">
<td style="empty-cells: show; line-height: normal; vertical-align: middle; outline-width: 0px; overflow-wrap: break-word; word-break: normal; font-family: &#34;Microsoft YaHei&#34;; font-size: 10pt; border-width: 0.5pt; border-style: solid; border-color: rgb(0, 0, 0);">
				<font style="white-space: pre-wrap; font-size: 10pt;">明朝中后期西南沿海一个重要的问题就是倭寇的骚扰，这个问题本来是有希望被当时的浙江总督用和平的方法解决掉的，但是中途就出了个王本固这个插曲。</font></td>
<td style="empty-cells: show; line-height: normal; vertical-align: middle; outline-width: 0px; overflow-wrap: break-word; word-break: normal; white-space: nowrap; text-align: center; font-family: &#34;Microsoft YaHei&#34;; font-size: 10pt; border-width: 0.5pt; border-style: solid; border-color: rgb(0, 0, 0);">
				<font style="white-space: pre-wrap; font-size: 10pt;">历史</font></td>
</tr>
</tbody>
</table>
<p>
其中，&#8220;类别&#8221;是事先定义好的。一段文本可以属于多个类别，例如，第2个例子可以同时属于&#8220;历史&#8221;和&#8220;明朝&#8221;这两个类别。<br />
<span id="more-12754"></span><br />
<span style="background-color: rgb(255, 255, 0);">✓</span>&#160;fastText是什么<br />
fastText是Facebook于2016年开源的一个词向量计算和<span style="color:#0000ff;">文本分类</span>工具，官方定义：</p>
<blockquote>
<p>
		Library for efficient text classification and representation learning</p>
</blockquote>
<p>工具如其名，&#8220;fast&#8221;，表明它的速度很快。<br />
fastText应用很广泛，本文以<span style="color:#0000ff;">只有1个类别</span>的<span style="color:#ff0000;">中文</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="background-color: rgb(255, 255, 0);">✓</span>&#160;安装fastText<br />
fastText 有一个在命令行直接就能用的可执行程序，也有Python的接口，这两样东西我们都装上。<br />
安装、使用fastText对编译器版本、Python版本都有一定的要求，可以查看fastText网站了解这些信息。</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="bash language-bash 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;">wget&#160;https://github.com/facebookresearch/fastText/archive/v0.9.2.zip</code></pre>&#8230; <a href="https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e4%bd%bf%e7%94%a8-fasttext-%e5%81%9a%e4%b8%ad%e6%96%87%e6%96%87%e6%9c%ac%e5%88%86%e7%b1%bb1/" class="read-more">Read More </a></section>]]></description>
										<content:encoded><![CDATA[<p>查看本系列文章合集，请看<a href="https://www.codelast.com/?p=12856" target="_blank" rel="noopener noreferrer"><span style="background-color:#ffa07a;">这里</span></a>。</p>
<p><span style="background-color: rgb(255, 255, 0);">✓</span>&nbsp;什么是&ldquo;文本分类&rdquo;</p>
<blockquote>
<p>
		它是图书馆学， 信息学和计算机科学中的一个问题。其任务是将一个文档分配到一个或者多个类别中。</p>
</blockquote>
<p>举例：</p>
<table selecttype="cells" style="border-collapse: collapse;">
<colgroup>
<col style="width: 550px;" width="550" />
<col style="width: 107px;" width="107" />
	</colgroup>
<tbody>
<tr height="24" style="height: 24px;">
<td style="empty-cells: show; line-height: normal; vertical-align: middle; outline-width: 0px; overflow-wrap: break-word; word-break: normal; white-space: nowrap; text-align: center; font-family: &quot;Microsoft YaHei&quot;; font-size: 10pt; background-color: rgb(223, 248, 255); border-width: 0.5pt; border-style: solid; border-color: rgb(0, 0, 0);">
				<font style="white-space: pre-wrap; font-size: 10pt;">文本</font></td>
<td style="empty-cells: show; line-height: normal; vertical-align: middle; outline-width: 0px; overflow-wrap: break-word; word-break: normal; white-space: nowrap; text-align: center; font-family: &quot;Microsoft YaHei&quot;; font-size: 10pt; background-color: rgb(223, 248, 255); border-width: 0.5pt; border-style: solid; border-color: rgb(0, 0, 0);">
				<font style="white-space: pre-wrap; font-size: 10pt;">类别</font></td>
</tr>
<tr height="24" style="height: 24px;">
<td style="empty-cells: show; line-height: normal; vertical-align: middle; outline-width: 0px; overflow-wrap: break-word; word-break: normal; font-family: &quot;Microsoft YaHei&quot;; font-size: 10pt; border-top: 0.5pt solid rgb(0, 0, 0); border-right: 0.5pt solid rgb(0, 0, 0); border-left: 0.5pt solid rgb(0, 0, 0);">
				<font style="white-space: pre-wrap; font-size: 10pt;">瑞幸咖啡今日发布声明称，瑞幸咖啡公司将于6月29日在纳斯达克停牌，并进行退市备案。声明表示，在国内消费市场方面，瑞幸咖啡全国4000多家门店将正常运营，近3万名员工仍将一如既往的为用户提供优质产品和服务。公司衷心感谢广大消费者的支持厚爱，并再次为事件造成的恶劣影响向社会各界诚挚道歉。</font></td>
<td style="empty-cells: show; line-height: normal; vertical-align: middle; outline-width: 0px; overflow-wrap: break-word; word-break: normal; white-space: nowrap; text-align: center; font-family: &quot;Microsoft YaHei&quot;; font-size: 10pt; border-top: 0.5pt solid rgb(0, 0, 0); border-right: 0.5pt solid rgb(0, 0, 0); border-left: 0.5pt solid rgb(0, 0, 0);">
				<font style="white-space: pre-wrap; font-size: 10pt;">财经</font></td>
</tr>
<tr height="24" style="height: 24px;">
<td style="empty-cells: show; line-height: normal; vertical-align: middle; outline-width: 0px; overflow-wrap: break-word; word-break: normal; font-family: &quot;Microsoft YaHei&quot;; font-size: 10pt; border-width: 0.5pt; border-style: solid; border-color: rgb(0, 0, 0);">
				<font style="white-space: pre-wrap; font-size: 10pt;">明朝中后期西南沿海一个重要的问题就是倭寇的骚扰，这个问题本来是有希望被当时的浙江总督用和平的方法解决掉的，但是中途就出了个王本固这个插曲。</font></td>
<td style="empty-cells: show; line-height: normal; vertical-align: middle; outline-width: 0px; overflow-wrap: break-word; word-break: normal; white-space: nowrap; text-align: center; font-family: &quot;Microsoft YaHei&quot;; font-size: 10pt; border-width: 0.5pt; border-style: solid; border-color: rgb(0, 0, 0);">
				<font style="white-space: pre-wrap; font-size: 10pt;">历史</font></td>
</tr>
</tbody>
</table>
<p>
其中，&ldquo;类别&rdquo;是事先定义好的。一段文本可以属于多个类别，例如，第2个例子可以同时属于&ldquo;历史&rdquo;和&ldquo;明朝&rdquo;这两个类别。<br />
<span id="more-12754"></span><br />
<span style="background-color: rgb(255, 255, 0);">✓</span>&nbsp;fastText是什么<br />
fastText是Facebook于2016年开源的一个词向量计算和<span style="color:#0000ff;">文本分类</span>工具，官方定义：</p>
<blockquote>
<p>
		Library for efficient text classification and representation learning</p>
</blockquote>
<p>工具如其名，&ldquo;fast&rdquo;，表明它的速度很快。<br />
fastText应用很广泛，本文以<span style="color:#0000ff;">只有1个类别</span>的<span style="color:#ff0000;">中文</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="background-color: rgb(255, 255, 0);">✓</span>&nbsp;安装fastText<br />
fastText 有一个在命令行直接就能用的可执行程序，也有Python的接口，这两样东西我们都装上。<br />
安装、使用fastText对编译器版本、Python版本都有一定的要求，可以查看fastText网站了解这些信息。</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="bash language-bash 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;">wget&nbsp;https://github.com/facebookresearch/fastText/archive/v0.9.2.zip
unzip&nbsp;v0.9.2.zip
<span class="hljs-built_in" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">cd</span>&nbsp;fastText-0.9.2
make
pip&nbsp;install&nbsp;.
</code></pre>
</section>
<p>本文写作时，fastText的最新版是 0.9.2，如果版本有更新，上面的命令要跟着修改。<br />
我们会看到当前目录下生成了一个名为&ldquo;fasttext&rdquo;的可执行程序。这样，fastText就可以开始用了。但这只是万里长征第一步，之后的文本预处理、类别标注才是最麻烦的。</p>
<p><span style="background-color: rgb(255, 255, 0);">✓</span>&nbsp;文本分类的流程<br />
并不是我们有了文本数据（一行一个字符串），就能直接喂给fastText训练出来一个分类模型了，我们不仅要对数据进行一些细致的清洗，还要把输入fastText的数据做成它要求的格式，这样它才能识别并训练出模型。</p>
<p>简单地说，文本分类的过程主要由以下步骤构成：<br />
● 对待分类的文本数据做预处理。例如：去掉文本里的乱七八糟的字符、标点符号，等等。并且，由于中文不像英文有天然的空格做为词与词之间的分隔符，因此，我们只能使用分词器来对中文句子进行分词。<br />
● 对文本进行标注。fastText训练的是有监督的文本分类模型，你得先给它一堆例子：什么样的文本，对应的正确分类是什么。这样它才能学出一个模型，用于预测一个没有见过的文本的类别。标注可以由人工完成（效率低，一般不现实），也可以从一些可信的数据源获取文本的正确分类。<br />
● 把处理好的文本数据拆分成training集和validation集，training集用于训练模型，validation集用于检验模型效果。<br />
● 用fastText训练training集得到一个模型，用validation集检验模型效果，如果效果不好，调整模型训练的参数训练一个新模型继续检验效果。</p>
<p>下面，就依次描述以上各项。请看下一篇文章。</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>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e4%bd%bf%e7%94%a8-fasttext-%e5%81%9a%e4%b8%ad%e6%96%87%e6%96%87%e6%9c%ac%e5%88%86%e7%b1%bb1/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[原创] gnuplot调教记</title>
		<link>https://www.codelast.com/%e5%8e%9f%e5%88%9b-gnuplot%e8%b0%83%e6%95%99%e8%ae%b0/</link>
					<comments>https://www.codelast.com/%e5%8e%9f%e5%88%9b-gnuplot%e8%b0%83%e6%95%99%e8%ae%b0/#respond</comments>
		
		<dc:creator><![CDATA[learnhard]]></dc:creator>
		<pubDate>Fri, 24 Oct 2014 09:48:59 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[综合]]></category>
		<category><![CDATA[gnuplot]]></category>
		<category><![CDATA[X轴重复]]></category>
		<category><![CDATA[中文]]></category>
		<category><![CDATA[乱码]]></category>
		<category><![CDATA[字体]]></category>
		<category><![CDATA[日期]]></category>
		<category><![CDATA[日期重复]]></category>
		<category><![CDATA[画图]]></category>
		<guid isPermaLink="false">http://www.codelast.com/?p=8348</guid>

					<description><![CDATA[<p>
<a href="http://www.gnuplot.info/" rel="noopener noreferrer" target="_blank"><span style="background-color:#ffa07a;">gnuplot</span></a>是命令行绘图的极佳选择之一。用它画出一副简单的图极其容易，但是对画出的图进行微调却很令人抓狂，这主要&#8220;得益&#8221;于gnuplot超级强大的功能，以及无穷无尽纷繁复杂的说明文档，通常让人没时间去细细研究。<br />
如果你经常有gnuplot的使用需求，那么可以仔细研读一下它的文档，否则，还是像我一样，现学现用吧。<br />
我折腾了一天多时间，把我想要的一副图给画出来了，里面涉及到了很多图像的微调过程，有些解决方案很难搜到，但我运气稍好，终究还是弄出来了，在此，作为一个使用案例来分析一下。因此，本文并不是gnuplot的使用教程，而是用gnuplot绘图时，对某些奇怪问题的解决办法的分享。</p>
<p>本文基于gnuplot版本：4.4，系统：RHEL 5.3<br />
<span id="more-8348"></span><br />
<span style="background-color:#00ff00;">『1』</span>基本需求<br />
先说一下我要画图的基本需求。听上去很简单：就是二维平面上的X，Y坐标点线图。我有一个数据文件<span style="color:#0000ff;">data.txt</span>，第一列是日期，第二列是该日期下的数值，例如：</p>
<pre class="brush:plain;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
20141020	1525
20141019	1429
20141018	1321
20141017	1780
20141016	1655
</pre>
<p>下面来看看怎么把它画成图。</p>
<p><span style="background-color: rgb(0, 255, 0);">『2』</span>编写最简单的shell脚本<br />
在shell脚本中调用gnuplot，绘制出一个最简单的图：</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="bash language-bash 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;"><span class="hljs-meta" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(91, 218, 237); word-wrap: inherit !important; word-break: inherit !important;">#!/bin/bash
</span>
gnuplot&#160;&#60;&#60;&#160;EOF
&#160;&#160;<span class="hljs-built_in" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">set</span>&#160;terminal&#160;png
&#160;&#160;<span class="hljs-built_in" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">set</span>&#160;xdata&#160;time
&#160;&#160;<span class="hljs-built_in" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">set</span>&#160;timefmt&#160;<span class="hljs-string" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(238, 220, 112); word-wrap: inherit !important; word-break: inherit !important;">&#34;%Y%m%d&#34;</span>
&#160;&#160;<span class="hljs-built_in" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">set</span>&#160;output&#160;<span class="hljs-string" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(238, 220, 112); word-wrap: inherit !important; word-break: inherit !important;">&#34;output.png&#34;</span></code></pre>&#8230; <a href="https://www.codelast.com/%e5%8e%9f%e5%88%9b-gnuplot%e8%b0%83%e6%95%99%e8%ae%b0/" class="read-more">Read More </a></section>]]></description>
										<content:encoded><![CDATA[<p>
<a href="http://www.gnuplot.info/" rel="noopener noreferrer" target="_blank"><span style="background-color:#ffa07a;">gnuplot</span></a>是命令行绘图的极佳选择之一。用它画出一副简单的图极其容易，但是对画出的图进行微调却很令人抓狂，这主要&ldquo;得益&rdquo;于gnuplot超级强大的功能，以及无穷无尽纷繁复杂的说明文档，通常让人没时间去细细研究。<br />
如果你经常有gnuplot的使用需求，那么可以仔细研读一下它的文档，否则，还是像我一样，现学现用吧。<br />
我折腾了一天多时间，把我想要的一副图给画出来了，里面涉及到了很多图像的微调过程，有些解决方案很难搜到，但我运气稍好，终究还是弄出来了，在此，作为一个使用案例来分析一下。因此，本文并不是gnuplot的使用教程，而是用gnuplot绘图时，对某些奇怪问题的解决办法的分享。</p>
<p>本文基于gnuplot版本：4.4，系统：RHEL 5.3<br />
<span id="more-8348"></span><br />
<span style="background-color:#00ff00;">『1』</span>基本需求<br />
先说一下我要画图的基本需求。听上去很简单：就是二维平面上的X，Y坐标点线图。我有一个数据文件<span style="color:#0000ff;">data.txt</span>，第一列是日期，第二列是该日期下的数值，例如：</p>
<pre class="brush:plain;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
20141020	1525
20141019	1429
20141018	1321
20141017	1780
20141016	1655
</pre>
<p>下面来看看怎么把它画成图。</p>
<p><span style="background-color: rgb(0, 255, 0);">『2』</span>编写最简单的shell脚本<br />
在shell脚本中调用gnuplot，绘制出一个最简单的图：</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="bash language-bash 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;"><span class="hljs-meta" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(91, 218, 237); word-wrap: inherit !important; word-break: inherit !important;">#!/bin/bash
</span>
gnuplot&nbsp;&lt;&lt;&nbsp;EOF
&nbsp;&nbsp;<span class="hljs-built_in" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">set</span>&nbsp;terminal&nbsp;png
&nbsp;&nbsp;<span class="hljs-built_in" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">set</span>&nbsp;xdata&nbsp;time
&nbsp;&nbsp;<span class="hljs-built_in" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">set</span>&nbsp;timefmt&nbsp;<span class="hljs-string" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(238, 220, 112); word-wrap: inherit !important; word-break: inherit !important;">&quot;%Y%m%d&quot;</span>
&nbsp;&nbsp;<span class="hljs-built_in" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">set</span>&nbsp;output&nbsp;<span class="hljs-string" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(238, 220, 112); word-wrap: inherit !important; word-break: inherit !important;">&quot;output.png&quot;</span>
&nbsp;&nbsp;plot&nbsp;<span class="hljs-string" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(238, 220, 112); word-wrap: inherit !important; word-break: inherit !important;">&quot;data.txt&quot;</span>&nbsp;using&nbsp;1:2
&nbsp;&nbsp;&nbsp;&nbsp;quit
EOF
</code></pre>
</section>
<p>画出的图是这样的：</p>
<div style="text-align: center;">
	<img decoding="async" alt="" src="http://www.codelast.com/wp-content/uploads/2014/10/gnuplot_output_img_1.png" style="width: 640px; height: 480px;" /></div>
<p><span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">http://www.codelast.com/</span></a><br />
显然这个图非常难看，并且图上的某些内容让人匪夷所思，我们先不管它，先看看它是怎么运作的。<br />
在shell脚本中两个 <span style="color:#0000ff;">EOF</span> 中间的是gnuplot的绘图参数设置命令，每一条命令的含义分别是：<br />
<span style="color:#ff0000;">set terminal png</span>：将输出图片设置为png格式。<br />
<span style="color:#ff0000;">set xdata time</span>：设置X轴为时间。<br />
<span style="color:#ff0000;">set timefmt &quot;%Y%m%d&quot;</span>：设置输入数据的时间格式。<br />
<span style="color:#ff0000;">set output &quot;output.png&quot;</span>：设置输出图片的文件名，这里你可以使用绝对路径，此处为了简单，只使用相对路径，将输出到当前目录下。<br />
<span style="color:#ff0000;">plot &quot;data.txt&quot; using 1:2</span>：将 <span style="color:#0000ff;">data.txt</span> 作为输入数据文件，使用其第一列作为X轴，第2列作为Y轴。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">http://www.codelast.com/</span></a><br />
可见要画出一幅图是相当简单的，但是正如前面所说，要调整这幅图到你满意的程度，并不是一件简单的事情&mdash;&mdash;如果不调整，上面的乱糟糟图根本就没法看嘛！</p>
<p><span style="background-color: rgb(0, 255, 0);">『3』</span>漫长的参数调整过程<br />
<span style="background-color:#ffa07a;">（1）</span>去掉右上角的文字说明<br />
右上角有一个 <span style="color:#b22222;">&quot;data.txt&quot; using 1:2</span> 的说明，要去掉它，需要添加一句：</p>
<pre class="brush:plain;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
set nokey
</pre>
<p>画出的图变成了：</p>
<div style="text-align: center;">
	<img decoding="async" alt="" src="http://www.codelast.com/wp-content/uploads/2014/10/gnuplot_output_img_2.png" style="text-align: center; width: 640px; height: 480px;" /></div>
<p><span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">http://www.codelast.com/</span></a><br />
现在干净一点了。</p>
<p><span style="background-color: rgb(255, 160, 122);">（2）</span>更改X轴的日期显示格式<br />
将X轴的日期改为&ldquo;月-日&rdquo;（例如&ldquo;10-16&rdquo;），加一句代码即可：</p>
<pre class="brush:plain;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
set format x &quot;%m-%d&quot;
</pre>
<p>画出的图变成了：</p>
<div style="text-align: center;">
	<img decoding="async" alt="" src="http://www.codelast.com/wp-content/uploads/2014/10/gnuplot_output_img_3.png" style="text-align: center; width: 640px; height: 480px;" /></div>
<p><span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">http://www.codelast.com/</span></a><br />
X轴日期显示格式已改，没有悬念。有人说，但是它怎么有重复的日期啊？这个问题后面再说。</p>
<p><span style="background-color: rgb(255, 160, 122);">（3）</span>清除Y轴显示的数值<br />
添加代码：</p>
<pre class="brush:plain;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
set format y &quot;&quot;
</pre>
<p>画出的图变成了：</p>
<div style="text-align: center;">
	<img decoding="async" alt="" src="http://www.codelast.com/wp-content/uploads/2014/10/gnuplot_output_img_4.png" style="text-align: center; width: 640px; height: 480px;" /></div>
<p><span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">http://www.codelast.com/</span></a><br />
现在Y轴没数字了。</p>
<p><span style="background-color: rgb(255, 160, 122);">（4）</span>添加网格<br />
图中的任意两个点，它们的Y坐标值是否相同？如果这两个点离得稍微远一点，就看不清楚了，因此，为图像添加上网格，可以很好地辅助我们识别它们是否在同一水平线上：</p>
<pre class="brush:plain;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
set grid
</pre>
<p>画出的图变成了：</p>
<div style="text-align: center;">
	<img decoding="async" alt="" src="http://www.codelast.com/wp-content/uploads/2014/10/gnuplot_output_img_5.png" style="text-align: center; width: 640px; height: 480px;" /></div>
<p><span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">http://www.codelast.com/</span></a><br />
<span style="background-color: rgb(255, 160, 122);">（5）</span>去除X轴上重复的日期<br />
添加如下代码：</p>
<pre class="brush:plain;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
set xtics 60*60*24
</pre>
<p>画出的图变成了：</p>
<div style="text-align: center;">
	<img decoding="async" alt="" src="http://www.codelast.com/wp-content/uploads/2014/10/gnuplot_output_img_6.png" style="text-align: center; width: 640px; height: 480px;" /></div>
<p><span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">http://www.codelast.com/</span></a><br />
这句代码为什么能&ldquo;神奇&rdquo;地修复X轴坐标重复的问题？如果你有耐心，可以看看<a href="http://stackoverflow.com/questions/18647807/gnuplot-is-doubling-x-axis-labels-for-some-reason" rel="noopener noreferrer" target="_blank"><span style="background-color:#ffa07a;">这篇</span></a>文章的解释。它的大概原理是：当X轴显示的值是时间的时候，xtics 的增量单位是<span style="color:#0000ff;">秒</span>，如果你要它的增量单位是<span style="color:#0000ff;">天</span>，就需要将 xtics 设置为一天的秒数，即<span style="color:#b22222;">60*60*24</span>。</p>
<p><span style="background-color: rgb(255, 160, 122);">（6）</span>设置输入的数据文件的分隔符<br />
前面我们输入的数据文件data.txt以<span style="color:#0000ff;">\t</span>为两列的数据分隔符，但如果我有自定义的分隔符，是否要先把它转成\t，然后才能给gnuplot使用呢？不需要，只要用命令指定分隔符就可以了：</p>
<pre class="brush:plain;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
set datafile separator &quot;\t&quot;
</pre>
<p>
<span style="background-color: rgb(255, 160, 122);">（7）</span>点与点之间连线<br />
上面的图，画出的点实在太小了，如果相邻两点之间能用直线相连，看起来就清楚得多了：</p>
<pre class="brush:plain;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
plot &quot;data.txt&quot; using 1:2 with linespoints
</pre>
<p>画出的图变成了：</p>
<div style="text-align: center;">
	<img decoding="async" alt="" src="http://www.codelast.com/wp-content/uploads/2014/10/gnuplot_output_img_7.png" style="text-align: center; width: 640px; height: 480px;" /></div>
<p><span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">http://www.codelast.com/</span></a><br />
这是怎么做到的呢？plot 命令中的 <span style="color:#0000ff;">with&nbsp;linespoints</span> 指定了画出的图是点线图。</p>
<p><span style="background-color: rgb(255, 160, 122);">（8）</span>修改一下线的颜色，线的粗细，点的大小<br />
代码：</p>
<pre class="brush:plain;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
plot &quot;data.txt&quot; using 1:2 with linespoints linecolor 3 linewidth 1 pointtype 5 pointsize 1 
</pre>
<p>画出的图变成了：</p>
<div style="text-align: center;">
	<img decoding="async" alt="" src="http://www.codelast.com/wp-content/uploads/2014/10/gnuplot_output_img_8.png" style="text-align: center; width: 640px; height: 480px;" /></div>
<p><span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">http://www.codelast.com/</span></a><br />
这下就好看多了，在上面的代码中，linecolor指定了线的颜色，linewidth指定了线的宽度，pointtype指定了点的类型，pointsize指定了点的大小，可以参考gnuplot的官方文档获知诸如pointtype之类的代号分别代表什么样的点/线。</p>
<p><span style="background-color: rgb(255, 160, 122);">（9）</span>在点的旁边显示其纵坐标值<br />
前面我们已经把Y轴刻度去掉了，因此有必要在点的旁边显示其纵坐标值：</p>
<pre class="brush:plain;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
plot &quot;data.txt&quot; using 1:2 with linespoints linecolor 3 linewidth 1 pointtype 5 pointsize 1, &quot;&quot; using 1:2:2 with labels
</pre>
<p>画出的图变成了：</p>
<div style="text-align: center;">
	<img decoding="async" alt="" src="http://www.codelast.com/wp-content/uploads/2014/10/gnuplot_output_img_9.png" style="text-align: center; width: 640px; height: 480px;" /></div>
<p><span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">http://www.codelast.com/</span></a><br />
这一步的代码，比之前的代码多了 <span style="color:#0000ff;">&quot;&quot; using 1:2:2 with labels</span> 这部分。其中，<span style="color:#0000ff;">with labels</span> 表示在点旁边画上标签（label），但是这个label的值是什么呢？这里使用 using 1:2:2 表示第一列为X坐标值，第二列为Y坐标值，同时第二列也作为label的值。如果数据文件data.txt中有第三列，你可以用 using 1:2:3 来使用第三列作为label的值。有人说，上面还有一个空的双引号，是作什么用的呢？Sorry，这个真不记得了...</p>
<p><span style="background-color: rgb(255, 160, 122);">（10）</span>不要让label和数据点交错在一起<br />
上面的数据点被label的数值盖住了，看起来很不爽，我们把数值偏移一定的位置，让它们错开：</p>
<pre class="brush:plain;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
plot &quot;data.txt&quot; using 1:2 with linespoints linecolor 3 linewidth 1 pointtype 5 pointsize 1, &quot;&quot; using 1:2:2 with labels center offset 0,0.5
</pre>
<div style="text-align: center;">
	<img decoding="async" alt="" src="http://www.codelast.com/wp-content/uploads/2014/10/gnuplot_output_img_10.png" style="text-align: center; width: 640px; height: 480px;" /></div>
<p><span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">http://www.codelast.com/</span></a><br />
这下漂亮多了！起这个作用的代码是&nbsp;<span style="color:#0000ff;">center offset 0,0.5</span>。其中，<span style="color:#0000ff;">center</span> 加不加我没发现有什么区别；<span style="color:#0000ff;">offset 0,0.5</span> 表示把label在X轴方向平称0，在Y轴方向平移0.5。注意，平移的单位既不是像素，也不是和Y轴一样的单位，而是&ldquo;相对距离&rdquo;，不信我们可以把 <span style="color:#0000ff;">offset 0,0.5</span> 改成 <span style="color:#ff0000;">offset -1,1</span>，会看到label向左、向上都平移了一个单位，也就是下面这个样子：</p>
<div style="text-align: center;">
	<img decoding="async" alt="" src="http://www.codelast.com/wp-content/uploads/2014/10/gnuplot_output_img_11.png" style="text-align: center; width: 640px; height: 480px;" /></div>
<p><span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">http://www.codelast.com/</span></a><br />
可见label平移的距离远不止一个像素点，并且向上平移的距离也不是Y轴的&ldquo;1&rdquo;。<br />
这个把label和数据点错开的方法，代码极其简单，但是为了找到这个solution，我搜遍了网页，试了无数种方法，其他的都有各种各样的显示问题，就是这样写才最好，找得我要吐血。</p>
<p><span style="background-color: rgb(255, 160, 122);">（11）</span>为X轴添加上说明文字<br />
添加代码：</p>
<pre class="brush:plain;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
set xlabel &quot;Date&quot; textcolor lt 1
</pre>
<p>画出的图变成了：</p>
<div style="text-align: center;">
	<img decoding="async" alt="" src="http://www.codelast.com/wp-content/uploads/2014/10/gnuplot_output_img_12.png" style="text-align: center; width: 640px; height: 480px;" /></div>
<p><span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">http://www.codelast.com/</span></a><br />
其中，<span style="color:#0000ff;">textcolor lt 1</span> 指定了文字的颜色。</p>
<p><span style="background-color: rgb(255, 160, 122);">（12）</span>把X轴的说明文字改成中文<br />
简单地把上面的&ldquo;<span style="color:#b22222;">Date</span>&rdquo;改为中文的&ldquo;日期&rdquo;，看看画出的图会变成什么：</p>
<div style="text-align: center;">
	<img decoding="async" alt="" src="http://www.codelast.com/wp-content/uploads/2014/10/gnuplot_output_img_13.png" style="text-align: center; width: 640px; height: 480px;" /></div>
<p><span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">http://www.codelast.com/</span></a><br />
不出所料，中文乱码了。<br />
解决这个问题没有那么容易，虽然解决方案有千千万，不过我认为最实用的方法就是：在系统中安装支持中文的字体，并且在使用gnuplot绘图时指定使用这个字体：</p>
<pre class="brush:plain;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
set term png font &quot;/usr/share/fonts/truetype/wqy/wqy-microhei.ttc,12&quot;
</pre>
<p>这句话的前半部分含义与&nbsp;<span style="color:#0000ff;">set terminal png</span> 相同，后半部分指定了使用的字体的路径以及文字的大小。wqy-microhei.ttc 即为<a href="http://wenq.org/wqy2/index.cgi" rel="noopener noreferrer" target="_blank"><span style="background-color:#ffa07a;">文泉驿</span></a>微米黑字体文件，可以从很多地方下载到，当然你也可以尝试使用其他的字体。字体文件不一定要放在&nbsp;/usr/share/fonts/truetype/wqy/ 路径下，但是最好遵循Linux系统中其他字体的规则。<br />
这样，画出的图就变成了：<br />
<img decoding="async" alt="" src="http://www.codelast.com/wp-content/uploads/2014/10/gnuplot_output_img_14.png" style="text-align: center; width: 640px; height: 480px;" /><br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">http://www.codelast.com/</span></a><br />
<span style="background-color: rgb(255, 160, 122);">（13）</span>为图片添加标题（title）<br />
在上面已经搞定中文输出的基础上，我们再添加中文的title就很容易了：</p>
<pre class="brush:plain;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
set title &quot;每天售出的商品数量&quot; textcolor lt 1
</pre>
<p>画出的图变成了：</p>
<div style="text-align: center;">
	<img decoding="async" alt="" src="http://www.codelast.com/wp-content/uploads/2014/10/gnuplot_output_img_15.png" style="text-align: center; width: 640px; height: 480px;" /></div>
<p><span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">http://www.codelast.com/</span></a><br />
<span style="background-color: rgb(255, 160, 122);">（14）</span>图片两边太挤了，空出一定的空隙<br />
添加代码：</p>
<pre class="brush:plain;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
set offset graph 0.10, 0.10
</pre>
<p>画出的图变成了：</p>
<div style="text-align: center;">
	<img decoding="async" alt="" src="http://www.codelast.com/wp-content/uploads/2014/10/gnuplot_output_img_16.png" style="text-align: center; width: 640px; height: 480px;" /></div>
<p><span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">http://www.codelast.com/</span></a><br />
上面的代码使得我们最左、最右的两个点不会碰到坐标轴，看上去舒服多了。至于它的具体含义，我不记得了，总之可以通过调整offset的数值来观察效果。</p>
<p><span style="background-color: rgb(0, 255, 0);">『4』</span>总结<br />
经过上面的一系列调整，我们终于得到了一幅看上去比较顺眼的图片。最后把完整的代码贴上来：</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="bash language-bash 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;"><span class="hljs-meta" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(91, 218, 237); word-wrap: inherit !important; word-break: inherit !important;">#!/bin/bash
</span>
gnuplot&nbsp;&lt;&lt;&nbsp;EOF
&nbsp;&nbsp;<span class="hljs-built_in" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">set</span>&nbsp;term&nbsp;png&nbsp;font&nbsp;<span class="hljs-string" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(238, 220, 112); word-wrap: inherit !important; word-break: inherit !important;">&quot;/usr/share/fonts/truetype/wqy/wqy-microhei.ttc,12&quot;</span>
&nbsp;&nbsp;<span class="hljs-built_in" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">set</span>&nbsp;nokey
&nbsp;&nbsp;<span class="hljs-built_in" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">set</span>&nbsp;xdata&nbsp;time
&nbsp;&nbsp;<span class="hljs-built_in" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">set</span>&nbsp;timefmt&nbsp;<span class="hljs-string" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(238, 220, 112); word-wrap: inherit !important; word-break: inherit !important;">&quot;%Y%m%d&quot;</span>
&nbsp;&nbsp;<span class="hljs-built_in" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">set</span>&nbsp;format&nbsp;x&nbsp;<span class="hljs-string" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(238, 220, 112); word-wrap: inherit !important; word-break: inherit !important;">&quot;%m-%d&quot;</span>
&nbsp;&nbsp;<span class="hljs-built_in" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">set</span>&nbsp;format&nbsp;y&nbsp;<span class="hljs-string" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(238, 220, 112); word-wrap: inherit !important; word-break: inherit !important;">&quot;&quot;</span>
&nbsp;&nbsp;<span class="hljs-built_in" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">set</span>&nbsp;offset&nbsp;graph&nbsp;0.10,&nbsp;0.10
&nbsp;&nbsp;<span class="hljs-built_in" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">set</span>&nbsp;xtics&nbsp;60*60*24
&nbsp;&nbsp;<span class="hljs-built_in" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">set</span>&nbsp;grid
&nbsp;&nbsp;<span class="hljs-built_in" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">set</span>&nbsp;title&nbsp;<span class="hljs-string" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(238, 220, 112); word-wrap: inherit !important; word-break: inherit !important;">&quot;每天售出的商品数量&quot;</span>&nbsp;textcolor&nbsp;lt&nbsp;1
&nbsp;&nbsp;<span class="hljs-built_in" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">set</span>&nbsp;xlabel&nbsp;<span class="hljs-string" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(238, 220, 112); word-wrap: inherit !important; word-break: inherit !important;">&quot;日期&quot;</span>&nbsp;textcolor&nbsp;lt&nbsp;1
&nbsp;&nbsp;<span class="hljs-built_in" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">set</span>&nbsp;output&nbsp;<span class="hljs-string" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(238, 220, 112); word-wrap: inherit !important; word-break: inherit !important;">&quot;output.png&quot;</span>
&nbsp;&nbsp;<span class="hljs-built_in" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">set</span>&nbsp;datafile&nbsp;separator&nbsp;<span class="hljs-string" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(238, 220, 112); word-wrap: inherit !important; word-break: inherit !important;">&quot;\t&quot;</span>
&nbsp;&nbsp;plot&nbsp;<span class="hljs-string" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(238, 220, 112); word-wrap: inherit !important; word-break: inherit !important;">&quot;data.txt&quot;</span>&nbsp;using&nbsp;1:2&nbsp;with&nbsp;linespoints&nbsp;linecolor&nbsp;3&nbsp;linewidth&nbsp;1&nbsp;pointtype&nbsp;5&nbsp;pointsize&nbsp;1,&nbsp;<span class="hljs-string" style="font-size: inherit; line-height: inherit; margin: 0px; padding: 0px; color: rgb(238, 220, 112); word-wrap: inherit !important; word-break: inherit !important;">&quot;&quot;</span>&nbsp;using&nbsp;1:2:2&nbsp;with&nbsp;labels&nbsp;center&nbsp;offset&nbsp;0,0.5
&nbsp;&nbsp;&nbsp;&nbsp;quit
EOF
</code></pre>
</section>
<p>
另附几个常见错误的解决办法：<br />
<span style="color:#0000ff;">（1）</span>Could not find/open font when opening font &quot;arial&quot;, using internal non-scalable font<br />
没有设置字体的时候可能会出现这个错误，这时，你可以指定一个系统中已有的字体，或者安装一个新字体并指定使用它，就可以避免这个问题，例如，安装文泉驿正黑字体：</p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
yum install wqy-zenhei-fonts.noarch
</pre>
<p>然后在绘图代码中：</p>
<pre class="brush:plain;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
set term png font &quot;/usr/share/fonts/wqy-zenhei/wqy-zenhei.ttc&quot; 10
</pre>
<p>表示使用 /usr/share/fonts/wqy-zenhei/wqy-zenhei.ttc 这个刚安装上的字体文件作为图像中的字体，并且字号为10。<br />
<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="http://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">http://www.codelast.com/</span></a><br />
<span style="color:#0000ff;">（2）</span>shell调用gnuplot时，shell的内置变量（$1，$2，&hellip;）与gnuplot的内置变量冲突的问题<br />
在shell脚本中，$1，$2，&hellip; 表示传给shell脚本的参数，这与在gnuplot的交互模式下，gnuplot定义的含义是不同的。<br />
在gnuplot的交互模式下，$1，$2，&hellip; 之类的变量是指输入数据文件的第1列，第2列，&hellip;<br />
所以现在问题来了，当用shell脚本调用gnuplot时（就像本文上面给出的代码一样），如何能让gnuplot代码的$1，$2仍然取到的是数据文件的第1列，第2列？<br />
<a href="http://stackoverflow.com/questions/4179591/how-to-manipulate-column-values-when-using-gnuplot-from-a-shell-script" rel="noopener noreferrer" target="_blank"><span style="background-color:#ffa07a;">这篇</span></a>文章给出了解答，这里把几种方法列举如下：</p>
<pre class="brush:plain;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
&#39;$1&#39;
&quot;\$1&quot;
\$1
</pre>
<p>
<span style="color:#0000ff;">（3）</span>如何在画出的曲线图中，每N个坐标点才标一个Y坐标值，而不是每个坐标点都标？<br />
某些数据的点非常密集，如果我们把每个点旁边都标上它的Y坐标值，会导致图上的文字密密麻麻地挤在一起，从而使得我们根本看不清，因此，在这种情况下，我们只需要每N个点才标一个Y坐标值就可以了。<br />
这个解决办法需要有点技巧。<br />
假设某个数据文件 data.txt 的第1列是点的顺序编号（1，2，3，&hellip;&hellip;），第2列是该点的纵坐标值，假设最后绘制图像的那一句是：</p>
<pre class="brush:plain;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
plot &quot;data.txt&quot; using 1:2 with linespoints linecolor 3 linewidth 1 pointtype 5 pointsize 1, &quot;&quot; using 1:2:2 with labels center offset 0,0.5
</pre>
<p>现在要对这一句进行特殊处理，使得它做到&ldquo;每5个点绘制一个Y坐标值&rdquo;，那么我们只需要把 <span style="color:#ff0000;">using 1:2:2</span> 这里改成：</p>
<pre class="brush:plain;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
using 1:2:(int(\$1) % 5 == 0 ? sprintf(&quot;%.3f&quot;, \$2) : &quot;&quot;)
</pre>
<p>解释：<br />
本来<span style="color:#ff0000;">1:2:</span><span style="color:#0000ff;">2</span>的最后一个 <span style="color:#0000ff;">2</span> 表示将数据文件data.txt的第2列作为label的值（在这里也就是Y坐标值），但是我们把它改成了一个条件判断语句，gnuplot是支持的，很强大。<br />
这个条件判断语句的含义是：当data.txt数据文件的第1列的值是5的整数倍的时候，我们打印出第2列的实际数值（以小数点后3位小数的格式），否则我们就打印出一个空字符串（这实际上导致了什么也不会打印出来）。<br />
大家注意了，这里的为了取数据文件的第1列、第2列，用了 <span style="color:#ff0000;">\$1</span> 以及 <span style="color:#ff0000;">\$2</span> 的形式，我在前面第（2）条里说过了，这是由于shell脚本内置的参数变量$1，$2与gnuplot有冲突，所以要转义。<br />
另外，为什么会在 <span style="color:#ff0000;">\$1</span>&nbsp;外面包一个 <span style="color:#0000ff;">int()</span> 呢？如果没有的话，gnuplot会打印出类似于&ldquo;can only mod ints&rdquo;的一个错误提示。<br />
这种解决方案比较微妙，但是它确实达到了我想要的效果。<br />
那有人会说，如果data.txt的第一列不是点的顺序编号呢？在这种情况下，可以用程序自动地为data.txt加上一列（第1列），使其成为顺序编号，然后用第2、第3列来绘图就可以了。</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>

			<!--[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/shBrushPlain.js"></script>
<script type="text/javascript" src="https://www.codelast.com/wp-content/plugins/ck-and-syntaxhighlighter/syntaxhighlighter/scripts/shBrushShell.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-gnuplot%e8%b0%83%e6%95%99%e8%ae%b0/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>shell脚本因文件编码问题不能正确执行的问题</title>
		<link>https://www.codelast.com/shell%e8%84%9a%e6%9c%ac%e5%9b%a0%e6%96%87%e4%bb%b6%e7%bc%96%e7%a0%81%e9%97%ae%e9%a2%98%e4%b8%8d%e8%83%bd%e6%ad%a3%e7%a1%ae%e6%89%a7%e8%a1%8c%e7%9a%84%e9%97%ae%e9%a2%98/</link>
					<comments>https://www.codelast.com/shell%e8%84%9a%e6%9c%ac%e5%9b%a0%e6%96%87%e4%bb%b6%e7%bc%96%e7%a0%81%e9%97%ae%e9%a2%98%e4%b8%8d%e8%83%bd%e6%ad%a3%e7%a1%ae%e6%89%a7%e8%a1%8c%e7%9a%84%e9%97%ae%e9%a2%98/#respond</comments>
		
		<dc:creator><![CDATA[learnhard]]></dc:creator>
		<pubDate>Tue, 14 Dec 2010 12:26:44 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[ANSI]]></category>
		<category><![CDATA[BOM]]></category>
		<category><![CDATA[cannot execute binary file]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[ps]]></category>
		<category><![CDATA[SecureCRT]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[UltraEdit]]></category>
		<category><![CDATA[UTF-8]]></category>
		<category><![CDATA[UTF8]]></category>
		<category><![CDATA[vi]]></category>
		<category><![CDATA[中文]]></category>
		<category><![CDATA[去除]]></category>
		<category><![CDATA[文件]]></category>
		<category><![CDATA[汉字]]></category>
		<category><![CDATA[编码]]></category>
		<category><![CDATA[错误]]></category>
		<guid isPermaLink="false">http://www.codelast.com/?p=912</guid>

					<description><![CDATA[<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;">遇到一例因shell文件的编码问题导致执行后不能得到正确结果的问题。一般来说脚本中不会带有中文，不过有时候例外，例如你要查找一个文本中的字符串，cat test.txt &#124; grep &#34;汽车&#34; &#160;这样的命令，如果文件编码不对，就可能得不到正确结果。</span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span id="more-912"></span></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;">我的问题是：有一个脚本，无论怎么执行结果都不对，但是我把它里面的关键的几句话单独拿出来，在SecureCRT终端下依次执行，最后得到的结果却正确，奇了。于是我终于想起来可能有中文的影响，在终端里查看shell脚本的内容，发现不能正确显示出一处中文（乱码了），可见正是这处乱码，导致了grep输出的结果不正确。但是在SecureCRT终端下，无论是用vi还是emacs，我都无法向文件中输入中文（上屏的中文全都乱码），于是怀疑是文件编码问题。</span></span></p>
<p>
	<span style="font-size: 14px; color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" style="font-size: 14px; " 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:微软雅黑;">然后我就将脚本下载到Windows下，用UltraEdit将其另存为UTF-8格式，再上传到Linux中，再执行脚本，竟然报错：<strong><span style="color:#f00;">cannot execute binary file</span></strong></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;">这种问题的原因之一是脚本中有不可识别字符。于是我再用UltraEdit，将文件重新存为&#8220;<strong><span style="color:#00f;">UTF-8 无 BOM</span></strong>&#8221;格式（如下图），再上传到Linux中，就可以正确执行了。</span></span></p>
<p style="text-align: center; ">
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><img decoding="async" alt="另存为UTF-8 无BOM格式" src="http://www.codelast.com/wp-content/uploads/2011/11/utf-8_no_bom_file_format.jpg" style="width: 353px; height: 103px; " /><br />
	</span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;">网上还有很多文章，介绍了如何用emacs，vi 或 vim更改文件编码的方法，应该也是可以的，但用UltraEdit最方便。</span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><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></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;">另外再记一个小技巧：用 ps -ef &#124; grep XXX 命令查看系统中是否存在某个进程的时候，输出结果中会包含有grep命令这一行，例如：</span></span></p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
ps -ef &#124; grep httpd
</pre>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;">部分输出为：</span></span></p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
root     27154 27129  0 20:35 pts/3    00:00:00 grep httpd
daemon   28834  2955  3 13:35 ?</pre>&#8230; <a href="https://www.codelast.com/shell%e8%84%9a%e6%9c%ac%e5%9b%a0%e6%96%87%e4%bb%b6%e7%bc%96%e7%a0%81%e9%97%ae%e9%a2%98%e4%b8%8d%e8%83%bd%e6%ad%a3%e7%a1%ae%e6%89%a7%e8%a1%8c%e7%9a%84%e9%97%ae%e9%a2%98/" class="read-more">Read More </a>]]></description>
										<content:encoded><![CDATA[<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;">遇到一例因shell文件的编码问题导致执行后不能得到正确结果的问题。一般来说脚本中不会带有中文，不过有时候例外，例如你要查找一个文本中的字符串，cat test.txt | grep &quot;汽车&quot; &nbsp;这样的命令，如果文件编码不对，就可能得不到正确结果。</span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span id="more-912"></span></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;">我的问题是：有一个脚本，无论怎么执行结果都不对，但是我把它里面的关键的几句话单独拿出来，在SecureCRT终端下依次执行，最后得到的结果却正确，奇了。于是我终于想起来可能有中文的影响，在终端里查看shell脚本的内容，发现不能正确显示出一处中文（乱码了），可见正是这处乱码，导致了grep输出的结果不正确。但是在SecureCRT终端下，无论是用vi还是emacs，我都无法向文件中输入中文（上屏的中文全都乱码），于是怀疑是文件编码问题。</span></span></p>
<p>
	<span style="font-size: 14px; color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" style="font-size: 14px; " 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:微软雅黑;">然后我就将脚本下载到Windows下，用UltraEdit将其另存为UTF-8格式，再上传到Linux中，再执行脚本，竟然报错：<strong><span style="color:#f00;">cannot execute binary file</span></strong></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;">这种问题的原因之一是脚本中有不可识别字符。于是我再用UltraEdit，将文件重新存为&ldquo;<strong><span style="color:#00f;">UTF-8 无 BOM</span></strong>&rdquo;格式（如下图），再上传到Linux中，就可以正确执行了。</span></span></p>
<p style="text-align: center; ">
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><img decoding="async" alt="另存为UTF-8 无BOM格式" src="http://www.codelast.com/wp-content/uploads/2011/11/utf-8_no_bom_file_format.jpg" style="width: 353px; height: 103px; " /><br />
	</span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;">网上还有很多文章，介绍了如何用emacs，vi 或 vim更改文件编码的方法，应该也是可以的，但用UltraEdit最方便。</span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><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></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;">另外再记一个小技巧：用 ps -ef | grep XXX 命令查看系统中是否存在某个进程的时候，输出结果中会包含有grep命令这一行，例如：</span></span></p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
ps -ef | grep httpd
</pre>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;">部分输出为：</span></span></p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
root     27154 27129  0 20:35 pts/3    00:00:00 grep httpd
daemon   28834  2955  3 13:35 ?        00:16:23 /usr/local/apache2/bin/httpd -k start
</pre>
<p>
	<span style="font-size: 14px; ">可见第一行是干扰，我们不想看到它，那么可以有两种方法来过滤掉这一行：</span></p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
ps -ef | grep httpd | grep -v grep
</pre>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><font class="Apple-style-span">或：</font></span></span></p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
ps -Ao pid,comm,args | grep httpd
</pre>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><font class="Apple-style-span">这种方法输出的内容中只包含进程号、进程名、调用参数，具体使用可man ps。</font></span></span></p>
<p>
	<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>

			<!--[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>

			<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/shell%e8%84%9a%e6%9c%ac%e5%9b%a0%e6%96%87%e4%bb%b6%e7%bc%96%e7%a0%81%e9%97%ae%e9%a2%98%e4%b8%8d%e8%83%bd%e6%ad%a3%e7%a1%ae%e6%89%a7%e8%a1%8c%e7%9a%84%e9%97%ae%e9%a2%98/feed/</wfw:commentRss>
			<slash:comments>0</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>
