chillerlan-QRCode-Data-Hanzi.html 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Documentation</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <base href="../">
  8. <link rel="icon" href="images/favicon.ico"/>
  9. <link rel="stylesheet" href="css/normalize.css">
  10. <link rel="stylesheet" href="css/base.css">
  11. <link rel="preconnect" href="https://fonts.gstatic.com">
  12. <link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600;700&display=swap" rel="stylesheet">
  13. <link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
  14. <link rel="stylesheet" href="css/template.css">
  15. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
  16. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
  17. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
  18. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
  19. <script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
  20. <script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
  21. <script src="js/search.js"></script>
  22. <script defer src="js/searchIndex.js"></script>
  23. </head>
  24. <body id="top">
  25. <header class="phpdocumentor-header phpdocumentor-section">
  26. <h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">Documentation</a></h1>
  27. <input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
  28. <label class="phpdocumentor-header__menu-icon" for="menu-button">
  29. <i class="fas fa-bars"></i>
  30. </label>
  31. <section data-search-form class="phpdocumentor-search">
  32. <label>
  33. <span class="visually-hidden">Search for</span>
  34. <svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
  35. <circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
  36. <line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
  37. </svg>
  38. <input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
  39. </label>
  40. </section>
  41. <nav class="phpdocumentor-topnav">
  42. <ul class="phpdocumentor-topnav__menu">
  43. </ul>
  44. </nav>
  45. </header>
  46. <main class="phpdocumentor">
  47. <div class="phpdocumentor-section">
  48. <input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
  49. <label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
  50. Menu
  51. </label>
  52. <aside class="phpdocumentor-column -four phpdocumentor-sidebar">
  53. <section class="phpdocumentor-sidebar__category">
  54. <h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
  55. <h4 class="phpdocumentor-sidebar__root-namespace">
  56. <a href="namespaces/chillerlan.html" class="">chillerlan</a>
  57. </h4>
  58. <ul class="phpdocumentor-list">
  59. <li>
  60. <a href="namespaces/chillerlan-qrcode.html" class="">QRCode</a>
  61. </li>
  62. <li>
  63. <a href="namespaces/chillerlan-qrcodetest.html" class="">QRCodeTest</a>
  64. </li>
  65. </ul>
  66. </section>
  67. <section class="phpdocumentor-sidebar__category">
  68. <h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
  69. <h4 class="phpdocumentor-sidebar__root-namespace">
  70. <a href="packages/Application.html" class="">Application</a>
  71. </h4>
  72. </section>
  73. <section class="phpdocumentor-sidebar__category">
  74. <h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
  75. <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
  76. <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
  77. <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
  78. </section>
  79. <section class="phpdocumentor-sidebar__category">
  80. <h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
  81. <h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
  82. </section>
  83. </aside>
  84. <div class="phpdocumentor-column -eight phpdocumentor-content">
  85. <ul class="phpdocumentor-breadcrumbs">
  86. <li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan.html">chillerlan</a></li>
  87. <li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan-qrcode.html">QRCode</a></li>
  88. <li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan-qrcode-data.html">Data</a></li>
  89. </ul>
  90. <article class="phpdocumentor-element -class">
  91. <h2 class="phpdocumentor-content__title">
  92. Hanzi
  93. <span class="phpdocumentor-element__extends">
  94. extends <a href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html"><abbr title="\chillerlan\QRCode\Data\QRDataModeAbstract">QRDataModeAbstract</abbr></a>
  95. </span>
  96. <div class="phpdocumentor-element__package">
  97. in package
  98. <ul class="phpdocumentor-breadcrumbs">
  99. <li class="phpdocumentor-breadcrumb"><a href="packages/Application.html">Application</a></li>
  100. </ul>
  101. </div>
  102. </h2>
  103. <aside class="phpdocumentor-element-found-in">
  104. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/Hanzi.php"><a href="files/src-data-hanzi.html"><abbr title="src/Data/Hanzi.php">Hanzi.php</abbr></a></abbr>
  105. :
  106. <span class="phpdocumentor-element-found-in__line">31</span>
  107. </aside>
  108. <p class="phpdocumentor-summary">Hanzi (simplified Chinese) mode, GBT18284-2000: 13-bit double-byte characters from the GB2312/GB18030 character set</p>
  109. <section class="phpdocumentor-description"><p>Please note that this is not part of the QR Code specification and may not be supported by all readers (ZXing-based ones do).</p>
  110. </section>
  111. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  112. Tags
  113. <a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
  114. </h5>
  115. <dl class="phpdocumentor-tag-list">
  116. <dt class="phpdocumentor-tag-list__entry">
  117. <span class="phpdocumentor-tag__name">see</span>
  118. </dt>
  119. <dd class="phpdocumentor-tag-list__definition">
  120. <span class="phpdocumentor-tag-link"><a href="https://en.wikipedia.org/wiki/GB_2312"><abbr title="https://en.wikipedia.org/wiki/GB_2312">https://en.wikipedia.org/wiki/GB_2312</abbr></a></span>
  121. </dd>
  122. <dt class="phpdocumentor-tag-list__entry">
  123. <span class="phpdocumentor-tag__name">see</span>
  124. </dt>
  125. <dd class="phpdocumentor-tag-list__definition">
  126. <span class="phpdocumentor-tag-link"><a href="http://www.herongyang.com/GB2312/Introduction-of-GB2312.html"><abbr title="http://www.herongyang.com/GB2312/Introduction-of-GB2312.html">http://www.herongyang.com/GB2312/Introduction-of-GB2312.html</abbr></a></span>
  127. </dd>
  128. <dt class="phpdocumentor-tag-list__entry">
  129. <span class="phpdocumentor-tag__name">see</span>
  130. </dt>
  131. <dd class="phpdocumentor-tag-list__definition">
  132. <span class="phpdocumentor-tag-link"><a href="https://en.wikipedia.org/wiki/GBK_(character_encoding)#Encoding"><abbr title="https://en.wikipedia.org/wiki/GBK_(character_encoding)#Encoding">https://en.wikipedia.org/wiki/GBK_(character_encoding)#Encoding</abbr></a></span>
  133. </dd>
  134. <dt class="phpdocumentor-tag-list__entry">
  135. <span class="phpdocumentor-tag__name">see</span>
  136. </dt>
  137. <dd class="phpdocumentor-tag-list__definition">
  138. <span class="phpdocumentor-tag-link"><a href="https://gist.github.com/codemasher/91da33c44bfb48a81a6c1426bb8e4338"><abbr title="https://gist.github.com/codemasher/91da33c44bfb48a81a6c1426bb8e4338">https://gist.github.com/codemasher/91da33c44bfb48a81a6c1426bb8e4338</abbr></a></span>
  139. </dd>
  140. <dt class="phpdocumentor-tag-list__entry">
  141. <span class="phpdocumentor-tag__name">see</span>
  142. </dt>
  143. <dd class="phpdocumentor-tag-list__definition">
  144. <span class="phpdocumentor-tag-link"><a href="https://github.com/zxing/zxing/blob/dfb06fa33b17a9e68321be151c22846c7b78048f/core/src/main/java/com/google/zxing/qrcode/decoder/DecodedBitStreamParser.java#L172-L209"><abbr title="https://github.com/zxing/zxing/blob/dfb06fa33b17a9e68321be151c22846c7b78048f/core/src/main/java/com/google/zxing/qrcode/decoder/DecodedBitStreamParser.java#L172-L209">https://github.com/zxing/zxing/blob/dfb06fa33b17a9e68321be151c22846c7b78048f/core/src/main/java/com/google/zxing/qrcode/decoder/DecodedBitStreamParser.java#L172-L209</abbr></a></span>
  145. </dd>
  146. <dt class="phpdocumentor-tag-list__entry">
  147. <span class="phpdocumentor-tag__name">see</span>
  148. </dt>
  149. <dd class="phpdocumentor-tag-list__definition">
  150. <span class="phpdocumentor-tag-link"><a href="https://www.chinesestandard.net/PDF/English.aspx/GBT18284-2000"><abbr title="https://www.chinesestandard.net/PDF/English.aspx/GBT18284-2000">https://www.chinesestandard.net/PDF/English.aspx/GBT18284-2000</abbr></a></span>
  151. </dd>
  152. </dl>
  153. <h3 id="toc">
  154. Table of Contents
  155. <a href="#toc" class="headerlink"><i class="fas fa-link"></i></a>
  156. </h3>
  157. <dl class="phpdocumentor-table-of-contents">
  158. <dt class="phpdocumentor-table-of-contents__entry -constant -public">
  159. <a href="classes/chillerlan-QRCode-Data-Hanzi.html#constant_DATAMODE">DATAMODE</a>
  160. <span>
  161. &nbsp;= \chillerlan\QRCode\Common\Mode::HANZI </span>
  162. </dt>
  163. <dd></dd>
  164. <dt class="phpdocumentor-table-of-contents__entry -constant -public">
  165. <a href="classes/chillerlan-QRCode-Data-Hanzi.html#constant_ENCODING">ENCODING</a>
  166. <span>
  167. &nbsp;= &#039;GB18030&#039; </span>
  168. </dt>
  169. <dd>possible values: GB2312, GB18030</dd>
  170. <dt class="phpdocumentor-table-of-contents__entry -constant -public">
  171. <a href="classes/chillerlan-QRCode-Data-Hanzi.html#constant_GB2312_SUBSET">GB2312_SUBSET</a>
  172. <span>
  173. &nbsp;= 0b1 </span>
  174. </dt>
  175. <dd></dd>
  176. <dt class="phpdocumentor-table-of-contents__entry -property -protected">
  177. <a href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#property_data">$data</a>
  178. <span>
  179. &nbsp;: string </span>
  180. </dt>
  181. <dd>The data to write</dd>
  182. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  183. <a href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#method___construct">__construct()</a>
  184. <span>
  185. &nbsp;: mixed </span>
  186. </dt>
  187. <dd>QRDataModeAbstract constructor.</dd>
  188. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  189. <a href="classes/chillerlan-QRCode-Data-Hanzi.html#method_convertEncoding">convertEncoding()</a>
  190. <span>
  191. &nbsp;: string </span>
  192. </dt>
  193. <dd>encoding conversion helper</dd>
  194. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  195. <a href="classes/chillerlan-QRCode-Data-Hanzi.html#method_decodeSegment">decodeSegment()</a>
  196. <span>
  197. &nbsp;: string </span>
  198. </dt>
  199. <dd>See specification GBT 18284-2000</dd>
  200. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  201. <a href="classes/chillerlan-QRCode-Data-Hanzi.html#method_getLengthInBits">getLengthInBits()</a>
  202. <span>
  203. &nbsp;: int </span>
  204. </dt>
  205. <dd></dd>
  206. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  207. <a href="classes/chillerlan-QRCode-Data-Hanzi.html#method_validateString">validateString()</a>
  208. <span>
  209. &nbsp;: bool </span>
  210. </dt>
  211. <dd>checks if a string qualifies as Hanzi/GB2312</dd>
  212. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  213. <a href="classes/chillerlan-QRCode-Data-Hanzi.html#method_write">write()</a>
  214. <span>
  215. &nbsp;: <a href="classes/chillerlan-QRCode-Data-QRDataModeInterface.html"><abbr title="\chillerlan\QRCode\Data\QRDataModeInterface">QRDataModeInterface</abbr></a> </span>
  216. </dt>
  217. <dd></dd>
  218. <dt class="phpdocumentor-table-of-contents__entry -method -protected">
  219. <a href="classes/chillerlan-QRCode-Data-Hanzi.html#method_getCharCount">getCharCount()</a>
  220. <span>
  221. &nbsp;: int </span>
  222. </dt>
  223. <dd>returns the character count of the $data string</dd>
  224. <dt class="phpdocumentor-table-of-contents__entry -method -protected">
  225. <a href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#method_getLengthBits">getLengthBits()</a>
  226. <span>
  227. &nbsp;: int </span>
  228. </dt>
  229. <dd>shortcut</dd>
  230. </dl>
  231. <section class="phpdocumentor-constants">
  232. <h3 class="phpdocumentor-elements__header" id="constants">
  233. Constants
  234. <a href="classes/chillerlan-QRCode-Data-Hanzi.html#constants" class="headerlink"><i class="fas fa-link"></i></a>
  235. </h3>
  236. <article class="phpdocumentor-element -constant -public ">
  237. <h4 class="phpdocumentor-element__name" id="constant_DATAMODE">
  238. DATAMODE
  239. <a href="classes/chillerlan-QRCode-Data-Hanzi.html#constant_DATAMODE" class="headerlink"><i class="fas fa-link"></i></a>
  240. </h4>
  241. <aside class="phpdocumentor-element-found-in">
  242. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/Hanzi.php"><a href="files/src-data-hanzi.html"><abbr title="src/Data/Hanzi.php">Hanzi.php</abbr></a></abbr>
  243. :
  244. <span class="phpdocumentor-element-found-in__line">50</span>
  245. </aside>
  246. <code class="phpdocumentor-signature phpdocumentor-code ">
  247. <span class="phpdocumentor-signature__visibility">public</span>
  248. <span class="phpdocumentor-signature__type">mixed</span>
  249. <span class="phpdocumentor-signature__name">DATAMODE</span>
  250. = <span class="phpdocumentor-signature__default-value">\chillerlan\QRCode\Common\Mode::HANZI</span>
  251. </code>
  252. <section class="phpdocumentor-description"></section>
  253. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  254. Tags
  255. <a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
  256. </h5>
  257. <dl class="phpdocumentor-tag-list">
  258. <dt class="phpdocumentor-tag-list__entry">
  259. <span class="phpdocumentor-tag__name">inheritDoc</span>
  260. </dt>
  261. <dd class="phpdocumentor-tag-list__definition">
  262. </dd>
  263. </dl>
  264. </article>
  265. <article class="phpdocumentor-element -constant -public ">
  266. <h4 class="phpdocumentor-element__name" id="constant_ENCODING">
  267. ENCODING
  268. <a href="classes/chillerlan-QRCode-Data-Hanzi.html#constant_ENCODING" class="headerlink"><i class="fas fa-link"></i></a>
  269. </h4>
  270. <aside class="phpdocumentor-element-found-in">
  271. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/Hanzi.php"><a href="files/src-data-hanzi.html"><abbr title="src/Data/Hanzi.php">Hanzi.php</abbr></a></abbr>
  272. :
  273. <span class="phpdocumentor-element-found-in__line">38</span>
  274. </aside>
  275. <p class="phpdocumentor-summary">possible values: GB2312, GB18030</p>
  276. <code class="phpdocumentor-signature phpdocumentor-code ">
  277. <span class="phpdocumentor-signature__visibility">public</span>
  278. <span class="phpdocumentor-signature__type">string</span>
  279. <span class="phpdocumentor-signature__name">ENCODING</span>
  280. = <span class="phpdocumentor-signature__default-value">&#039;GB18030&#039;</span>
  281. </code>
  282. </article>
  283. <article class="phpdocumentor-element -constant -public ">
  284. <h4 class="phpdocumentor-element__name" id="constant_GB2312_SUBSET">
  285. GB2312_SUBSET
  286. <a href="classes/chillerlan-QRCode-Data-Hanzi.html#constant_GB2312_SUBSET" class="headerlink"><i class="fas fa-link"></i></a>
  287. </h4>
  288. <aside class="phpdocumentor-element-found-in">
  289. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/Hanzi.php"><a href="files/src-data-hanzi.html"><abbr title="src/Data/Hanzi.php">Hanzi.php</abbr></a></abbr>
  290. :
  291. <span class="phpdocumentor-element-found-in__line">45</span>
  292. </aside>
  293. <code class="phpdocumentor-signature phpdocumentor-code ">
  294. <span class="phpdocumentor-signature__visibility">public</span>
  295. <span class="phpdocumentor-signature__type">int</span>
  296. <span class="phpdocumentor-signature__name">GB2312_SUBSET</span>
  297. = <span class="phpdocumentor-signature__default-value">0b1</span>
  298. </code>
  299. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  300. Tags
  301. <a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
  302. </h5>
  303. <dl class="phpdocumentor-tag-list">
  304. <dt class="phpdocumentor-tag-list__entry">
  305. <span class="phpdocumentor-tag__name">todo:</span>
  306. </dt>
  307. <dd class="phpdocumentor-tag-list__definition">
  308. <section class="phpdocumentor-description"><p>other subsets???</p>
  309. </section>
  310. </dd>
  311. </dl>
  312. </article>
  313. </section>
  314. <section class="phpdocumentor-properties">
  315. <h3 class="phpdocumentor-elements__header" id="properties">
  316. Properties
  317. <a href="classes/chillerlan-QRCode-Data-Hanzi.html#properties" class="headerlink"><i class="fas fa-link"></i></a>
  318. </h3>
  319. <article
  320. class="
  321. phpdocumentor-element
  322. -property
  323. -protected
  324. "
  325. >
  326. <h4 class="phpdocumentor-element__name" id="property_data">
  327. $data
  328. <a href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#property_data" class="headerlink"><i class="fas fa-link"></i></a>
  329. <span class="phpdocumentor-element__modifiers">
  330. </span>
  331. </h4>
  332. <aside class="phpdocumentor-element-found-in">
  333. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/QRDataModeAbstract.php"><a href="files/src-data-qrdatamodeabstract.html"><abbr title="src/Data/QRDataModeAbstract.php">QRDataModeAbstract.php</abbr></a></abbr>
  334. :
  335. <span class="phpdocumentor-element-found-in__line">23</span>
  336. </aside>
  337. <p class="phpdocumentor-summary">The data to write</p>
  338. <code class="phpdocumentor-code phpdocumentor-signature ">
  339. <span class="phpdocumentor-signature__visibility">protected</span>
  340. <span class="phpdocumentor-signature__type">string</span>
  341. <span class="phpdocumentor-signature__name">$data</span>
  342. </code>
  343. <section class="phpdocumentor-description"></section>
  344. </article>
  345. </section>
  346. <section class="phpdocumentor-methods">
  347. <h3 class="phpdocumentor-elements__header" id="methods">
  348. Methods
  349. <a href="classes/chillerlan-QRCode-Data-Hanzi.html#methods" class="headerlink"><i class="fas fa-link"></i></a>
  350. </h3>
  351. <article
  352. class="phpdocumentor-element
  353. -method
  354. -public
  355. "
  356. >
  357. <h4 class="phpdocumentor-element__name" id="method___construct">
  358. __construct()
  359. <a href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#method___construct" class="headerlink"><i class="fas fa-link"></i></a>
  360. </h4>
  361. <aside class="phpdocumentor-element-found-in">
  362. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/QRDataModeAbstract.php"><a href="files/src-data-qrdatamodeabstract.html"><abbr title="src/Data/QRDataModeAbstract.php">QRDataModeAbstract.php</abbr></a></abbr>
  363. :
  364. <span class="phpdocumentor-element-found-in__line">30</span>
  365. </aside>
  366. <p class="phpdocumentor-summary">QRDataModeAbstract constructor.</p>
  367. <code class="phpdocumentor-code phpdocumentor-signature ">
  368. <span class="phpdocumentor-signature__visibility">public</span>
  369. <span class="phpdocumentor-signature__name">__construct</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$data</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code>
  370. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  371. <dl class="phpdocumentor-argument-list">
  372. <dt class="phpdocumentor-argument-list__entry">
  373. <span class="phpdocumentor-signature__argument__name">$data</span>
  374. : <span class="phpdocumentor-signature__argument__return-type">string</span>
  375. </dt>
  376. <dd class="phpdocumentor-argument-list__definition">
  377. <section class="phpdocumentor-description"></section>
  378. </dd>
  379. </dl>
  380. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  381. Tags
  382. <a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
  383. </h5>
  384. <dl class="phpdocumentor-tag-list">
  385. <dt class="phpdocumentor-tag-list__entry">
  386. <span class="phpdocumentor-tag__name">throws</span>
  387. </dt>
  388. <dd class="phpdocumentor-tag-list__definition">
  389. <span class="phpdocumentor-tag-link"><a href="classes/chillerlan-QRCode-Data-QRCodeDataException.html"><abbr title="\chillerlan\QRCode\Data\QRCodeDataException">QRCodeDataException</abbr></a></span>
  390. </dd>
  391. </dl>
  392. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  393. <span class="phpdocumentor-signature__response_type">mixed</span>
  394. &mdash;
  395. </article>
  396. <article
  397. class="phpdocumentor-element
  398. -method
  399. -public
  400. -static "
  401. >
  402. <h4 class="phpdocumentor-element__name" id="method_convertEncoding">
  403. convertEncoding()
  404. <a href="classes/chillerlan-QRCode-Data-Hanzi.html#method_convertEncoding" class="headerlink"><i class="fas fa-link"></i></a>
  405. </h4>
  406. <aside class="phpdocumentor-element-found-in">
  407. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/Hanzi.php"><a href="files/src-data-hanzi.html"><abbr title="src/Data/Hanzi.php">Hanzi.php</abbr></a></abbr>
  408. :
  409. <span class="phpdocumentor-element-found-in__line">69</span>
  410. </aside>
  411. <p class="phpdocumentor-summary">encoding conversion helper</p>
  412. <code class="phpdocumentor-code phpdocumentor-signature ">
  413. <span class="phpdocumentor-signature__visibility">public</span>
  414. <span class="phpdocumentor-signature__static">static</span> <span class="phpdocumentor-signature__name">convertEncoding</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$string</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">string</span></code>
  415. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  416. <dl class="phpdocumentor-argument-list">
  417. <dt class="phpdocumentor-argument-list__entry">
  418. <span class="phpdocumentor-signature__argument__name">$string</span>
  419. : <span class="phpdocumentor-signature__argument__return-type">string</span>
  420. </dt>
  421. <dd class="phpdocumentor-argument-list__definition">
  422. <section class="phpdocumentor-description"></section>
  423. </dd>
  424. </dl>
  425. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  426. Tags
  427. <a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
  428. </h5>
  429. <dl class="phpdocumentor-tag-list">
  430. <dt class="phpdocumentor-tag-list__entry">
  431. <span class="phpdocumentor-tag__name">inheritDoc</span>
  432. </dt>
  433. <dd class="phpdocumentor-tag-list__definition">
  434. </dd>
  435. </dl>
  436. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  437. <span class="phpdocumentor-signature__response_type">string</span>
  438. &mdash;
  439. </article>
  440. <article
  441. class="phpdocumentor-element
  442. -method
  443. -public
  444. -static "
  445. >
  446. <h4 class="phpdocumentor-element__name" id="method_decodeSegment">
  447. decodeSegment()
  448. <a href="classes/chillerlan-QRCode-Data-Hanzi.html#method_decodeSegment" class="headerlink"><i class="fas fa-link"></i></a>
  449. </h4>
  450. <aside class="phpdocumentor-element-found-in">
  451. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/Hanzi.php"><a href="files/src-data-hanzi.html"><abbr title="src/Data/Hanzi.php">Hanzi.php</abbr></a></abbr>
  452. :
  453. <span class="phpdocumentor-element-found-in__line">171</span>
  454. </aside>
  455. <p class="phpdocumentor-summary">See specification GBT 18284-2000</p>
  456. <code class="phpdocumentor-code phpdocumentor-signature ">
  457. <span class="phpdocumentor-signature__visibility">public</span>
  458. <span class="phpdocumentor-signature__static">static</span> <span class="phpdocumentor-signature__name">decodeSegment</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Common-BitBuffer.html"><abbr title="\chillerlan\QRCode\Common\BitBuffer">BitBuffer</abbr></a>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$bitBuffer</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$versionNumber</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">string</span></code>
  459. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  460. <dl class="phpdocumentor-argument-list">
  461. <dt class="phpdocumentor-argument-list__entry">
  462. <span class="phpdocumentor-signature__argument__name">$bitBuffer</span>
  463. : <span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Common-BitBuffer.html"><abbr title="\chillerlan\QRCode\Common\BitBuffer">BitBuffer</abbr></a></span>
  464. </dt>
  465. <dd class="phpdocumentor-argument-list__definition">
  466. <section class="phpdocumentor-description"></section>
  467. </dd>
  468. <dt class="phpdocumentor-argument-list__entry">
  469. <span class="phpdocumentor-signature__argument__name">$versionNumber</span>
  470. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  471. </dt>
  472. <dd class="phpdocumentor-argument-list__definition">
  473. <section class="phpdocumentor-description"></section>
  474. </dd>
  475. </dl>
  476. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  477. Tags
  478. <a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
  479. </h5>
  480. <dl class="phpdocumentor-tag-list">
  481. <dt class="phpdocumentor-tag-list__entry">
  482. <span class="phpdocumentor-tag__name">throws</span>
  483. </dt>
  484. <dd class="phpdocumentor-tag-list__definition">
  485. <span class="phpdocumentor-tag-link"><a href="classes/chillerlan-QRCode-Data-QRCodeDataException.html"><abbr title="\chillerlan\QRCode\Data\QRCodeDataException">QRCodeDataException</abbr></a></span>
  486. </dd>
  487. </dl>
  488. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  489. <span class="phpdocumentor-signature__response_type">string</span>
  490. &mdash;
  491. </article>
  492. <article
  493. class="phpdocumentor-element
  494. -method
  495. -public
  496. "
  497. >
  498. <h4 class="phpdocumentor-element__name" id="method_getLengthInBits">
  499. getLengthInBits()
  500. <a href="classes/chillerlan-QRCode-Data-Hanzi.html#method_getLengthInBits" class="headerlink"><i class="fas fa-link"></i></a>
  501. </h4>
  502. <aside class="phpdocumentor-element-found-in">
  503. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/Hanzi.php"><a href="files/src-data-hanzi.html"><abbr title="src/Data/Hanzi.php">Hanzi.php</abbr></a></abbr>
  504. :
  505. <span class="phpdocumentor-element-found-in__line">62</span>
  506. </aside>
  507. <code class="phpdocumentor-code phpdocumentor-signature ">
  508. <span class="phpdocumentor-signature__visibility">public</span>
  509. <span class="phpdocumentor-signature__name">getLengthInBits</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">int</span></code>
  510. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  511. Tags
  512. <a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
  513. </h5>
  514. <dl class="phpdocumentor-tag-list">
  515. <dt class="phpdocumentor-tag-list__entry">
  516. <span class="phpdocumentor-tag__name">inheritDoc</span>
  517. </dt>
  518. <dd class="phpdocumentor-tag-list__definition">
  519. </dd>
  520. </dl>
  521. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  522. <span class="phpdocumentor-signature__response_type">int</span>
  523. &mdash;
  524. </article>
  525. <article
  526. class="phpdocumentor-element
  527. -method
  528. -public
  529. -static "
  530. >
  531. <h4 class="phpdocumentor-element__name" id="method_validateString">
  532. validateString()
  533. <a href="classes/chillerlan-QRCode-Data-Hanzi.html#method_validateString" class="headerlink"><i class="fas fa-link"></i></a>
  534. </h4>
  535. <aside class="phpdocumentor-element-found-in">
  536. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/Hanzi.php"><a href="files/src-data-hanzi.html"><abbr title="src/Data/Hanzi.php">Hanzi.php</abbr></a></abbr>
  537. :
  538. <span class="phpdocumentor-element-found-in__line">94</span>
  539. </aside>
  540. <p class="phpdocumentor-summary">checks if a string qualifies as Hanzi/GB2312</p>
  541. <code class="phpdocumentor-code phpdocumentor-signature ">
  542. <span class="phpdocumentor-signature__visibility">public</span>
  543. <span class="phpdocumentor-signature__static">static</span> <span class="phpdocumentor-signature__name">validateString</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$string</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">bool</span></code>
  544. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  545. <dl class="phpdocumentor-argument-list">
  546. <dt class="phpdocumentor-argument-list__entry">
  547. <span class="phpdocumentor-signature__argument__name">$string</span>
  548. : <span class="phpdocumentor-signature__argument__return-type">string</span>
  549. </dt>
  550. <dd class="phpdocumentor-argument-list__definition">
  551. <section class="phpdocumentor-description"></section>
  552. </dd>
  553. </dl>
  554. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  555. <span class="phpdocumentor-signature__response_type">bool</span>
  556. &mdash;
  557. </article>
  558. <article
  559. class="phpdocumentor-element
  560. -method
  561. -public
  562. "
  563. >
  564. <h4 class="phpdocumentor-element__name" id="method_write">
  565. write()
  566. <a href="classes/chillerlan-QRCode-Data-Hanzi.html#method_write" class="headerlink"><i class="fas fa-link"></i></a>
  567. </h4>
  568. <aside class="phpdocumentor-element-found-in">
  569. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/Hanzi.php"><a href="files/src-data-hanzi.html"><abbr title="src/Data/Hanzi.php">Hanzi.php</abbr></a></abbr>
  570. :
  571. <span class="phpdocumentor-element-found-in__line">133</span>
  572. </aside>
  573. <code class="phpdocumentor-code phpdocumentor-signature ">
  574. <span class="phpdocumentor-signature__visibility">public</span>
  575. <span class="phpdocumentor-signature__name">write</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Common-BitBuffer.html"><abbr title="\chillerlan\QRCode\Common\BitBuffer">BitBuffer</abbr></a>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$bitBuffer</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$versionNumber</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type"><a href="classes/chillerlan-QRCode-Data-QRDataModeInterface.html"><abbr title="\chillerlan\QRCode\Data\QRDataModeInterface">QRDataModeInterface</abbr></a></span></code>
  576. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  577. <dl class="phpdocumentor-argument-list">
  578. <dt class="phpdocumentor-argument-list__entry">
  579. <span class="phpdocumentor-signature__argument__name">$bitBuffer</span>
  580. : <span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Common-BitBuffer.html"><abbr title="\chillerlan\QRCode\Common\BitBuffer">BitBuffer</abbr></a></span>
  581. </dt>
  582. <dd class="phpdocumentor-argument-list__definition">
  583. <section class="phpdocumentor-description"></section>
  584. </dd>
  585. <dt class="phpdocumentor-argument-list__entry">
  586. <span class="phpdocumentor-signature__argument__name">$versionNumber</span>
  587. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  588. </dt>
  589. <dd class="phpdocumentor-argument-list__definition">
  590. <section class="phpdocumentor-description"></section>
  591. </dd>
  592. </dl>
  593. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  594. Tags
  595. <a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
  596. </h5>
  597. <dl class="phpdocumentor-tag-list">
  598. <dt class="phpdocumentor-tag-list__entry">
  599. <span class="phpdocumentor-tag__name">inheritDoc</span>
  600. </dt>
  601. <dd class="phpdocumentor-tag-list__definition">
  602. </dd>
  603. <dt class="phpdocumentor-tag-list__entry">
  604. <span class="phpdocumentor-tag__name">throws</span>
  605. </dt>
  606. <dd class="phpdocumentor-tag-list__definition">
  607. <span class="phpdocumentor-tag-link"><a href="classes/chillerlan-QRCode-Data-QRCodeDataException.html"><abbr title="\chillerlan\QRCode\Data\QRCodeDataException">QRCodeDataException</abbr></a></span>
  608. <section class="phpdocumentor-description"><p>on an illegal character occurence</p>
  609. </section>
  610. </dd>
  611. </dl>
  612. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  613. <span class="phpdocumentor-signature__response_type"><a href="classes/chillerlan-QRCode-Data-QRDataModeInterface.html"><abbr title="\chillerlan\QRCode\Data\QRDataModeInterface">QRDataModeInterface</abbr></a></span>
  614. &mdash;
  615. </article>
  616. <article
  617. class="phpdocumentor-element
  618. -method
  619. -protected
  620. "
  621. >
  622. <h4 class="phpdocumentor-element__name" id="method_getCharCount">
  623. getCharCount()
  624. <a href="classes/chillerlan-QRCode-Data-Hanzi.html#method_getCharCount" class="headerlink"><i class="fas fa-link"></i></a>
  625. </h4>
  626. <aside class="phpdocumentor-element-found-in">
  627. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/Hanzi.php"><a href="files/src-data-hanzi.html"><abbr title="src/Data/Hanzi.php">Hanzi.php</abbr></a></abbr>
  628. :
  629. <span class="phpdocumentor-element-found-in__line">55</span>
  630. </aside>
  631. <p class="phpdocumentor-summary">returns the character count of the $data string</p>
  632. <code class="phpdocumentor-code phpdocumentor-signature ">
  633. <span class="phpdocumentor-signature__visibility">protected</span>
  634. <span class="phpdocumentor-signature__name">getCharCount</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">int</span></code>
  635. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  636. Tags
  637. <a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
  638. </h5>
  639. <dl class="phpdocumentor-tag-list">
  640. <dt class="phpdocumentor-tag-list__entry">
  641. <span class="phpdocumentor-tag__name">inheritDoc</span>
  642. </dt>
  643. <dd class="phpdocumentor-tag-list__definition">
  644. </dd>
  645. </dl>
  646. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  647. <span class="phpdocumentor-signature__response_type">int</span>
  648. &mdash;
  649. </article>
  650. <article
  651. class="phpdocumentor-element
  652. -method
  653. -protected
  654. -static "
  655. >
  656. <h4 class="phpdocumentor-element__name" id="method_getLengthBits">
  657. getLengthBits()
  658. <a href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#method_getLengthBits" class="headerlink"><i class="fas fa-link"></i></a>
  659. </h4>
  660. <aside class="phpdocumentor-element-found-in">
  661. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/QRDataModeAbstract.php"><a href="files/src-data-qrdatamodeabstract.html"><abbr title="src/Data/QRDataModeAbstract.php">QRDataModeAbstract.php</abbr></a></abbr>
  662. :
  663. <span class="phpdocumentor-element-found-in__line">57</span>
  664. </aside>
  665. <p class="phpdocumentor-summary">shortcut</p>
  666. <code class="phpdocumentor-code phpdocumentor-signature ">
  667. <span class="phpdocumentor-signature__visibility">protected</span>
  668. <span class="phpdocumentor-signature__static">static</span> <span class="phpdocumentor-signature__name">getLengthBits</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$versionNumber</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">int</span></code>
  669. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  670. <dl class="phpdocumentor-argument-list">
  671. <dt class="phpdocumentor-argument-list__entry">
  672. <span class="phpdocumentor-signature__argument__name">$versionNumber</span>
  673. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  674. </dt>
  675. <dd class="phpdocumentor-argument-list__definition">
  676. <section class="phpdocumentor-description"></section>
  677. </dd>
  678. </dl>
  679. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  680. <span class="phpdocumentor-signature__response_type">int</span>
  681. &mdash;
  682. </article>
  683. </section>
  684. <script type="text/javascript">
  685. function loadExternalCodeSnippets(line) {
  686. Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach((pre) => {
  687. var src = pre.getAttribute('data-src').replace( /\\/g, '/');
  688. var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
  689. var language = 'php';
  690. var code = document.createElement('code');
  691. code.className = 'language-' + language;
  692. pre.textContent = '';
  693. pre.setAttribute('data-line', line)
  694. code.textContent = 'Loading…';
  695. pre.appendChild(code);
  696. var xhr = new XMLHttpRequest();
  697. xhr.open('GET', src, true);
  698. xhr.onreadystatechange = function () {
  699. if (xhr.readyState == 4) {
  700. if (xhr.status < 400 && xhr.responseText) {
  701. code.textContent = xhr.responseText;
  702. Prism.highlightElement(code);
  703. }
  704. else if (xhr.status >= 400) {
  705. code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
  706. }
  707. else {
  708. code.textContent = '✖ Error: File does not exist, is empty or trying to view from localhost';
  709. }
  710. }
  711. };
  712. xhr.send(null);
  713. });
  714. }
  715. var modals = document.querySelectorAll("[data-modal]");
  716. modals.forEach(function (trigger) {
  717. trigger.addEventListener("click", function (event) {
  718. //event.preventDefault();
  719. const modal = document.getElementById(trigger.dataset.modal);
  720. modal.classList.add("phpdocumentor-modal__open");
  721. loadExternalCodeSnippets(trigger.dataset.line)
  722. const exits = modal.querySelectorAll("[data-exit-button]");
  723. exits.forEach(function (exit) {
  724. exit.addEventListener("click", function (event) {
  725. event.preventDefault();
  726. modal.classList.remove("phpdocumentor-modal__open");
  727. });
  728. });
  729. });
  730. });
  731. </script>
  732. </article>
  733. <section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
  734. <section class="phpdocumentor-search-results__dialog">
  735. <header class="phpdocumentor-search-results__header">
  736. <h2 class="phpdocumentor-search-results__title">Search results</h2>
  737. <button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
  738. </header>
  739. <section class="phpdocumentor-search-results__body">
  740. <ul class="phpdocumentor-search-results__entries"></ul>
  741. </section>
  742. </section>
  743. </section>
  744. </div>
  745. </div>
  746. <a href="classes/chillerlan-QRCode-Data-Hanzi.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
  747. </main>
  748. <script>
  749. cssVars({});
  750. </script>
  751. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
  752. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
  753. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
  754. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
  755. </body>
  756. </html>