chillerlan-QRCode-Data-QRDataModeInterface.html 35 KB

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