chillerlan-QRCode-Data-QRDataModeInterface.html 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729
  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=Open+Sans:wght@100;200;300;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/template.js"></script>
  22. <script src="js/search.js"></script>
  23. <script defer src="js/searchIndex.js"></script>
  24. </head>
  25. <body id="top">
  26. <header class="phpdocumentor-header phpdocumentor-section">
  27. <h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">Documentation</a></h1>
  28. <input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
  29. <label class="phpdocumentor-header__menu-icon" for="menu-button">
  30. <i class="fas fa-bars"></i>
  31. </label>
  32. <section data-search-form class="phpdocumentor-search">
  33. <label>
  34. <span class="visually-hidden">Search for</span>
  35. <svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
  36. <circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
  37. <line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
  38. </svg>
  39. <input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
  40. </label>
  41. </section>
  42. <nav class="phpdocumentor-topnav">
  43. <ul class="phpdocumentor-topnav__menu">
  44. <li class="phpdocumentor-topnav__menu-item -menu">
  45. <a href="https://php-qrcode.readthedocs.io">
  46. <span>
  47. User Manual
  48. </span>
  49. </a>
  50. </li>
  51. <li class="phpdocumentor-topnav__menu-item -social">
  52. <a href="https://github.com/chillerlan/php-qrcode">
  53. <span>
  54. <i class="fab fa-github"></i>
  55. </span>
  56. </a>
  57. </li>
  58. <li class="phpdocumentor-topnav__menu-item -social">
  59. <a href="https://github.com/chillerlan/php-qrcode/discussions">
  60. <span>
  61. <i class="fas fa-envelope-open-text"></i>
  62. </span>
  63. </a>
  64. </li>
  65. </ul>
  66. </nav>
  67. </header>
  68. <main class="phpdocumentor">
  69. <div class="phpdocumentor-section">
  70. <input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
  71. <label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
  72. Menu
  73. </label>
  74. <aside class="phpdocumentor-column -three phpdocumentor-sidebar">
  75. <section class="phpdocumentor-sidebar__category -namespaces">
  76. <h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
  77. <h4 class="phpdocumentor-sidebar__root-namespace">
  78. <a href="namespaces/chillerlan.html" class="">chillerlan</a>
  79. </h4>
  80. <ul class="phpdocumentor-list">
  81. <li>
  82. <a href="namespaces/chillerlan-qrcode.html" class="">QRCode</a>
  83. </li>
  84. <li>
  85. <a href="namespaces/chillerlan-qrcodetest.html" class="">QRCodeTest</a>
  86. </li>
  87. </ul>
  88. </section>
  89. <section class="phpdocumentor-sidebar__category -packages">
  90. <h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
  91. <h4 class="phpdocumentor-sidebar__root-namespace">
  92. <a href="packages/Application.html" class="">Application</a>
  93. </h4>
  94. </section>
  95. <section class="phpdocumentor-sidebar__category -reports">
  96. <h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
  97. <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
  98. <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
  99. <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
  100. </section>
  101. <section class="phpdocumentor-sidebar__category -indices">
  102. <h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
  103. <h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
  104. </section>
  105. </aside>
  106. <div class="phpdocumentor-column -nine phpdocumentor-content">
  107. <section>
  108. <ul class="phpdocumentor-breadcrumbs">
  109. <li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan.html">chillerlan</a></li>
  110. <li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan-qrcode.html">QRCode</a></li>
  111. <li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan-qrcode-data.html">Data</a></li>
  112. </ul>
  113. <article class="phpdocumentor-element -interface">
  114. <h2 class="phpdocumentor-content__title">
  115. QRDataModeInterface
  116. <div class="phpdocumentor-element__package">
  117. in
  118. <ul class="phpdocumentor-breadcrumbs">
  119. <li><a href="packages/Application.html">Application</a></li>
  120. </ul>
  121. </div>
  122. </h2>
  123. <aside class="phpdocumentor-element-found-in">
  124. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/QRDataModeInterface.php"><a href="files/src-data-qrdatamodeinterface.html"><abbr title="src/Data/QRDataModeInterface.php">QRDataModeInterface.php</abbr></a></abbr>
  125. :
  126. <span class="phpdocumentor-element-found-in__line">19</span>
  127. </aside>
  128. <p class="phpdocumentor-summary">Specifies the methods reqired for the data modules (Number, Alphanum, Byte and Kanji)</p>
  129. <h3 id="toc">
  130. Table of Contents
  131. <a href="classes/chillerlan-QRCode-Data-QRDataModeInterface.html#toc" class="headerlink"><i class="fas fa-link"></i></a>
  132. </h3>
  133. <h4 id="toc-constants">
  134. Constants
  135. <a href="classes/chillerlan-QRCode-Data-QRDataModeInterface.html#toc-constants" class="headerlink"><i class="fas fa-link"></i></a>
  136. </h4>
  137. <dl class="phpdocumentor-table-of-contents">
  138. <dt class="phpdocumentor-table-of-contents__entry -constant -public">
  139. <a class="" href="classes/chillerlan-QRCode-Data-QRDataModeInterface.html#constant_DATAMODE">DATAMODE</a>
  140. <span>
  141. &nbsp;= -1 </span>
  142. </dt>
  143. <dd>the current data mode: Number, Alphanum, Kanji, Hanzi, Byte, ECI</dd>
  144. </dl>
  145. <h4 id="toc-methods">
  146. Methods
  147. <a href="classes/chillerlan-QRCode-Data-QRDataModeInterface.html#toc-methods" class="headerlink"><i class="fas fa-link"></i></a>
  148. </h4>
  149. <dl class="phpdocumentor-table-of-contents">
  150. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  151. <a class="" href="classes/chillerlan-QRCode-Data-QRDataModeInterface.html#method_convertEncoding">convertEncoding()</a>
  152. <span>
  153. &nbsp;: string </span>
  154. </dt>
  155. <dd>encoding conversion helper</dd>
  156. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  157. <a class="" href="classes/chillerlan-QRCode-Data-QRDataModeInterface.html#method_decodeSegment">decodeSegment()</a>
  158. <span>
  159. &nbsp;: string </span>
  160. </dt>
  161. <dd>reads a segment from the BitBuffer and decodes in the current data mode</dd>
  162. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  163. <a class="" href="classes/chillerlan-QRCode-Data-QRDataModeInterface.html#method_getLengthInBits">getLengthInBits()</a>
  164. <span>
  165. &nbsp;: int </span>
  166. </dt>
  167. <dd>retruns the length in bits of the data string</dd>
  168. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  169. <a class="" href="classes/chillerlan-QRCode-Data-QRDataModeInterface.html#method_validateString">validateString()</a>
  170. <span>
  171. &nbsp;: bool </span>
  172. </dt>
  173. <dd>checks if the given string qualifies for the encoder module</dd>
  174. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  175. <a class="" href="classes/chillerlan-QRCode-Data-QRDataModeInterface.html#method_write">write()</a>
  176. <span>
  177. &nbsp;: static </span>
  178. </dt>
  179. <dd>writes the actual data string to the BitBuffer, uses the given version to determine the length bits</dd>
  180. </dl>
  181. <section class="phpdocumentor-constants">
  182. <h3 class="phpdocumentor-elements__header" id="constants">
  183. Constants
  184. <a href="classes/chillerlan-QRCode-Data-QRDataModeInterface.html#constants" class="headerlink"><i class="fas fa-link"></i></a>
  185. </h3>
  186. <article class="phpdocumentor-element -constant -public ">
  187. <h4 class="phpdocumentor-element__name" id="constant_DATAMODE">
  188. DATAMODE
  189. <a href="classes/chillerlan-QRCode-Data-QRDataModeInterface.html#constant_DATAMODE" class="headerlink"><i class="fas fa-link"></i></a>
  190. </h4>
  191. <aside class="phpdocumentor-element-found-in">
  192. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/QRDataModeInterface.php"><a href="files/src-data-qrdatamodeinterface.html"><abbr title="src/Data/QRDataModeInterface.php">QRDataModeInterface.php</abbr></a></abbr>
  193. :
  194. <span class="phpdocumentor-element-found-in__line">29</span>
  195. </aside>
  196. <p class="phpdocumentor-summary">the current data mode: Number, Alphanum, Kanji, Hanzi, Byte, ECI</p>
  197. <code class="phpdocumentor-signature phpdocumentor-code ">
  198. <span class="phpdocumentor-signature__visibility">public</span>
  199. <span class="phpdocumentor-signature__type">int</span>
  200. <span class="phpdocumentor-signature__name">DATAMODE</span>
  201. = <span class="phpdocumentor-signature__default-value">-1</span>
  202. </code>
  203. <section class="phpdocumentor-description"><p>Note: do not call this constant from the interface, but rather from one of the child classes</p>
  204. </section>
  205. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  206. Tags
  207. <a href="classes/chillerlan-QRCode-Data-QRDataModeInterface.html#constant_DATAMODE#tags" class="headerlink"><i class="fas fa-link"></i></a>
  208. </h5>
  209. <dl class="phpdocumentor-tag-list">
  210. <dt class="phpdocumentor-tag-list__entry">
  211. <span class="phpdocumentor-tag__name">see</span>
  212. </dt>
  213. <dd class="phpdocumentor-tag-list__definition">
  214. <span class="phpdocumentor-tag-link"><a href="classes/chillerlan-QRCode-Common-Mode.html"><abbr title="\chillerlan\QRCode\Common\Mode">Mode</abbr></a></span>
  215. </dd>
  216. </dl>
  217. </article>
  218. </section>
  219. <section class="phpdocumentor-methods">
  220. <h3 class="phpdocumentor-elements__header" id="methods">
  221. Methods
  222. <a href="classes/chillerlan-QRCode-Data-QRDataModeInterface.html#methods" class="headerlink"><i class="fas fa-link"></i></a>
  223. </h3>
  224. <article
  225. class="phpdocumentor-element
  226. -method
  227. -public
  228. -static "
  229. >
  230. <h4 class="phpdocumentor-element__name" id="method_convertEncoding">
  231. convertEncoding()
  232. <a href="classes/chillerlan-QRCode-Data-QRDataModeInterface.html#method_convertEncoding" class="headerlink"><i class="fas fa-link"></i></a>
  233. </h4>
  234. <aside class="phpdocumentor-element-found-in">
  235. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/QRDataModeInterface.php"><a href="files/src-data-qrdatamodeinterface.html"><abbr title="src/Data/QRDataModeInterface.php">QRDataModeInterface.php</abbr></a></abbr>
  236. :
  237. <span class="phpdocumentor-element-found-in__line">41</span>
  238. </aside>
  239. <p class="phpdocumentor-summary">encoding conversion helper</p>
  240. <code class="phpdocumentor-code phpdocumentor-signature ">
  241. <span class="phpdocumentor-signature__visibility">public</span>
  242. <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>
  243. <div class="phpdocumentor-label-line">
  244. </div>
  245. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  246. <dl class="phpdocumentor-argument-list">
  247. <dt class="phpdocumentor-argument-list__entry">
  248. <span class="phpdocumentor-signature__argument__name">$string</span>
  249. : <span class="phpdocumentor-signature__argument__return-type">string</span>
  250. </dt>
  251. <dd class="phpdocumentor-argument-list__definition">
  252. </dd>
  253. </dl>
  254. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  255. Tags
  256. <a href="classes/chillerlan-QRCode-Data-QRDataModeInterface.html#method_convertEncoding#tags" class="headerlink"><i class="fas fa-link"></i></a>
  257. </h5>
  258. <dl class="phpdocumentor-tag-list">
  259. <dt class="phpdocumentor-tag-list__entry">
  260. <span class="phpdocumentor-tag__name">throws</span>
  261. </dt>
  262. <dd class="phpdocumentor-tag-list__definition">
  263. <span class="phpdocumentor-tag-link"><a href="classes/chillerlan-QRCode-Data-QRCodeDataException.html"><abbr title="\chillerlan\QRCode\Data\QRCodeDataException">QRCodeDataException</abbr></a></span>
  264. </dd>
  265. </dl>
  266. <section>
  267. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  268. <span class="phpdocumentor-signature__response_type">string</span>
  269. </section>
  270. </article>
  271. <article
  272. class="phpdocumentor-element
  273. -method
  274. -public
  275. "
  276. >
  277. <h4 class="phpdocumentor-element__name" id="method_decodeSegment">
  278. decodeSegment()
  279. <a href="classes/chillerlan-QRCode-Data-QRDataModeInterface.html#method_decodeSegment" class="headerlink"><i class="fas fa-link"></i></a>
  280. </h4>
  281. <aside class="phpdocumentor-element-found-in">
  282. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/QRDataModeInterface.php"><a href="files/src-data-qrdatamodeinterface.html"><abbr title="src/Data/QRDataModeInterface.php">QRDataModeInterface.php</abbr></a></abbr>
  283. :
  284. <span class="phpdocumentor-element-found-in__line">58</span>
  285. </aside>
  286. <p class="phpdocumentor-summary">reads a segment from the BitBuffer and decodes in the current data mode</p>
  287. <code class="phpdocumentor-code phpdocumentor-signature ">
  288. <span class="phpdocumentor-signature__visibility">public</span>
  289. <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>
  290. <div class="phpdocumentor-label-line">
  291. </div>
  292. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  293. <dl class="phpdocumentor-argument-list">
  294. <dt class="phpdocumentor-argument-list__entry">
  295. <span class="phpdocumentor-signature__argument__name">$bitBuffer</span>
  296. : <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>
  297. </dt>
  298. <dd class="phpdocumentor-argument-list__definition">
  299. </dd>
  300. <dt class="phpdocumentor-argument-list__entry">
  301. <span class="phpdocumentor-signature__argument__name">$versionNumber</span>
  302. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  303. </dt>
  304. <dd class="phpdocumentor-argument-list__definition">
  305. </dd>
  306. </dl>
  307. <section>
  308. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  309. <span class="phpdocumentor-signature__response_type">string</span>
  310. </section>
  311. </article>
  312. <article
  313. class="phpdocumentor-element
  314. -method
  315. -public
  316. "
  317. >
  318. <h4 class="phpdocumentor-element__name" id="method_getLengthInBits">
  319. getLengthInBits()
  320. <a href="classes/chillerlan-QRCode-Data-QRDataModeInterface.html#method_getLengthInBits" class="headerlink"><i class="fas fa-link"></i></a>
  321. </h4>
  322. <aside class="phpdocumentor-element-found-in">
  323. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/QRDataModeInterface.php"><a href="files/src-data-qrdatamodeinterface.html"><abbr title="src/Data/QRDataModeInterface.php">QRDataModeInterface.php</abbr></a></abbr>
  324. :
  325. <span class="phpdocumentor-element-found-in__line">34</span>
  326. </aside>
  327. <p class="phpdocumentor-summary">retruns the length in bits of the data string</p>
  328. <code class="phpdocumentor-code phpdocumentor-signature ">
  329. <span class="phpdocumentor-signature__visibility">public</span>
  330. <span class="phpdocumentor-signature__name">getLengthInBits</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">int</span></code>
  331. <div class="phpdocumentor-label-line">
  332. </div>
  333. <section>
  334. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  335. <span class="phpdocumentor-signature__response_type">int</span>
  336. </section>
  337. </article>
  338. <article
  339. class="phpdocumentor-element
  340. -method
  341. -public
  342. -static "
  343. >
  344. <h4 class="phpdocumentor-element__name" id="method_validateString">
  345. validateString()
  346. <a href="classes/chillerlan-QRCode-Data-QRDataModeInterface.html#method_validateString" class="headerlink"><i class="fas fa-link"></i></a>
  347. </h4>
  348. <aside class="phpdocumentor-element-found-in">
  349. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/QRDataModeInterface.php"><a href="files/src-data-qrdatamodeinterface.html"><abbr title="src/Data/QRDataModeInterface.php">QRDataModeInterface.php</abbr></a></abbr>
  350. :
  351. <span class="phpdocumentor-element-found-in__line">46</span>
  352. </aside>
  353. <p class="phpdocumentor-summary">checks if the given string qualifies for the encoder module</p>
  354. <code class="phpdocumentor-code phpdocumentor-signature ">
  355. <span class="phpdocumentor-signature__visibility">public</span>
  356. <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>
  357. <div class="phpdocumentor-label-line">
  358. </div>
  359. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  360. <dl class="phpdocumentor-argument-list">
  361. <dt class="phpdocumentor-argument-list__entry">
  362. <span class="phpdocumentor-signature__argument__name">$string</span>
  363. : <span class="phpdocumentor-signature__argument__return-type">string</span>
  364. </dt>
  365. <dd class="phpdocumentor-argument-list__definition">
  366. </dd>
  367. </dl>
  368. <section>
  369. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  370. <span class="phpdocumentor-signature__response_type">bool</span>
  371. </section>
  372. </article>
  373. <article
  374. class="phpdocumentor-element
  375. -method
  376. -public
  377. "
  378. >
  379. <h4 class="phpdocumentor-element__name" id="method_write">
  380. write()
  381. <a href="classes/chillerlan-QRCode-Data-QRDataModeInterface.html#method_write" class="headerlink"><i class="fas fa-link"></i></a>
  382. </h4>
  383. <aside class="phpdocumentor-element-found-in">
  384. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/QRDataModeInterface.php"><a href="files/src-data-qrdatamodeinterface.html"><abbr title="src/Data/QRDataModeInterface.php">QRDataModeInterface.php</abbr></a></abbr>
  385. :
  386. <span class="phpdocumentor-element-found-in__line">53</span>
  387. </aside>
  388. <p class="phpdocumentor-summary">writes the actual data string to the BitBuffer, uses the given version to determine the length bits</p>
  389. <code class="phpdocumentor-code phpdocumentor-signature ">
  390. <span class="phpdocumentor-signature__visibility">public</span>
  391. <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">static</span></code>
  392. <div class="phpdocumentor-label-line">
  393. </div>
  394. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  395. <dl class="phpdocumentor-argument-list">
  396. <dt class="phpdocumentor-argument-list__entry">
  397. <span class="phpdocumentor-signature__argument__name">$bitBuffer</span>
  398. : <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>
  399. </dt>
  400. <dd class="phpdocumentor-argument-list__definition">
  401. </dd>
  402. <dt class="phpdocumentor-argument-list__entry">
  403. <span class="phpdocumentor-signature__argument__name">$versionNumber</span>
  404. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  405. </dt>
  406. <dd class="phpdocumentor-argument-list__definition">
  407. </dd>
  408. </dl>
  409. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  410. Tags
  411. <a href="classes/chillerlan-QRCode-Data-QRDataModeInterface.html#method_write#tags" class="headerlink"><i class="fas fa-link"></i></a>
  412. </h5>
  413. <dl class="phpdocumentor-tag-list">
  414. <dt class="phpdocumentor-tag-list__entry">
  415. <span class="phpdocumentor-tag__name">see</span>
  416. </dt>
  417. <dd class="phpdocumentor-tag-list__definition">
  418. <span class="phpdocumentor-tag-link"><a href="classes/chillerlan-QRCode-Data-QRData.html#method_writeBitBuffer"><abbr title="\chillerlan\QRCode\Data\QRData::writeBitBuffer()">QRData::writeBitBuffer()</abbr></a></span>
  419. </dd>
  420. </dl>
  421. <section>
  422. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  423. <span class="phpdocumentor-signature__response_type">static</span>
  424. </section>
  425. </article>
  426. </section>
  427. <div class="phpdocumentor-modal" id="source-view">
  428. <div class="phpdocumentor-modal-bg" data-exit-button></div>
  429. <div class="phpdocumentor-modal-container">
  430. <div class="phpdocumentor-modal-content">
  431. <pre style="max-height: 500px; overflow-y: scroll" data-src="files/src/Data/QRDataModeInterface.php.txt" class="language-php line-numbers linkable-line-numbers"></pre>
  432. </div>
  433. <button data-exit-button class="phpdocumentor-modal__close">&times;</button>
  434. </div>
  435. </div>
  436. <script type="text/javascript">
  437. (function () {
  438. function loadExternalCodeSnippet(el, url, line) {
  439. Array.prototype.slice.call(el.querySelectorAll('pre[data-src]')).forEach((pre) => {
  440. const src = url || pre.getAttribute('data-src').replace(/\\/g, '/');
  441. const language = 'php';
  442. const code = document.createElement('code');
  443. code.className = 'language-' + language;
  444. pre.textContent = '';
  445. pre.setAttribute('data-line', line)
  446. code.textContent = 'Loading…';
  447. pre.appendChild(code);
  448. var xhr = new XMLHttpRequest();
  449. xhr.open('GET', src, true);
  450. xhr.onreadystatechange = function () {
  451. if (xhr.readyState !== 4) {
  452. return;
  453. }
  454. if (xhr.status < 400 && xhr.responseText) {
  455. code.textContent = xhr.responseText;
  456. Prism.highlightElement(code);
  457. d=document.getElementsByClassName("line-numbers");
  458. d[0].scrollTop = d[0].children[1].offsetTop;
  459. return;
  460. }
  461. if (xhr.status === 404) {
  462. code.textContent = '✖ Error: File could not be found';
  463. return;
  464. }
  465. if (xhr.status >= 400) {
  466. code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
  467. return;
  468. }
  469. code.textContent = '✖ Error: An unknown error occurred';
  470. };
  471. xhr.send(null);
  472. });
  473. }
  474. const modalButtons = document.querySelectorAll("[data-modal]");
  475. const openedAsLocalFile = window.location.protocol === 'file:';
  476. if (modalButtons.length > 0 && openedAsLocalFile) {
  477. console.warn(
  478. 'Viewing the source code is unavailable because you are opening this page from the file:// scheme; ' +
  479. 'browsers block XHR requests when a page is opened this way'
  480. );
  481. }
  482. modalButtons.forEach(function (trigger) {
  483. if (openedAsLocalFile) {
  484. trigger.setAttribute("hidden", "hidden");
  485. }
  486. trigger.addEventListener("click", function (event) {
  487. event.preventDefault();
  488. const modal = document.getElementById(trigger.dataset.modal);
  489. if (!modal) {
  490. console.error(`Modal with id "${trigger.dataset.modal}" could not be found`);
  491. return;
  492. }
  493. modal.classList.add("phpdocumentor-modal__open");
  494. loadExternalCodeSnippet(modal, trigger.dataset.src || null, trigger.dataset.line)
  495. const exits = modal.querySelectorAll("[data-exit-button]");
  496. exits.forEach(function (exit) {
  497. exit.addEventListener("click", function (event) {
  498. event.preventDefault();
  499. modal.classList.remove("phpdocumentor-modal__open");
  500. });
  501. });
  502. });
  503. });
  504. })();
  505. </script>
  506. </article>
  507. </section>
  508. <section class="phpdocumentor-on-this-page__sidebar">
  509. <section class="phpdocumentor-on-this-page__content">
  510. <strong class="phpdocumentor-on-this-page__title">On this page</strong>
  511. <ul class="phpdocumentor-list -clean">
  512. <li class="phpdocumentor-on-this-page-section__title">Table Of Contents</li>
  513. <li>
  514. <ul class="phpdocumentor-list -clean">
  515. <li><a href="classes/chillerlan-QRCode-Data-QRDataModeInterface.html#toc-constants">Constants</a></li>
  516. <li><a href="classes/chillerlan-QRCode-Data-QRDataModeInterface.html#toc-methods">Methods</a></li>
  517. </ul>
  518. </li>
  519. <li class="phpdocumentor-on-this-page-section__title">Methods</li>
  520. <li>
  521. <ul class="phpdocumentor-list -clean">
  522. <li class=""><a href="classes/chillerlan-QRCode-Data-QRDataModeInterface.html#method_convertEncoding">convertEncoding()</a></li>
  523. <li class=""><a href="classes/chillerlan-QRCode-Data-QRDataModeInterface.html#method_decodeSegment">decodeSegment()</a></li>
  524. <li class=""><a href="classes/chillerlan-QRCode-Data-QRDataModeInterface.html#method_getLengthInBits">getLengthInBits()</a></li>
  525. <li class=""><a href="classes/chillerlan-QRCode-Data-QRDataModeInterface.html#method_validateString">validateString()</a></li>
  526. <li class=""><a href="classes/chillerlan-QRCode-Data-QRDataModeInterface.html#method_write">write()</a></li>
  527. </ul>
  528. </li>
  529. <li class="phpdocumentor-on-this-page-section__title">Constants</li>
  530. <li>
  531. <ul class="phpdocumentor-list -clean">
  532. <li class=""><a href="classes/chillerlan-QRCode-Data-QRDataModeInterface.html#constant_DATAMODE">DATAMODE</a></li>
  533. </ul>
  534. </li>
  535. </ul>
  536. </section>
  537. </section>
  538. </div>
  539. <section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
  540. <section class="phpdocumentor-search-results__dialog">
  541. <header class="phpdocumentor-search-results__header">
  542. <h2 class="phpdocumentor-search-results__title">Search results</h2>
  543. <button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
  544. </header>
  545. <section class="phpdocumentor-search-results__body">
  546. <ul class="phpdocumentor-search-results__entries"></ul>
  547. </section>
  548. </section>
  549. </section>
  550. </div>
  551. <a href="classes/chillerlan-QRCode-Data-QRDataModeInterface.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
  552. </main>
  553. <script>
  554. cssVars({});
  555. </script>
  556. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
  557. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
  558. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
  559. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
  560. </body>
  561. </html>