chillerlan-QRCode-Data-QRDataModeInterface.html 34 KB

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