chillerlan-QRCode-Data-Byte.html 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958
  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 -class">
  114. <h2 class="phpdocumentor-content__title">
  115. Byte
  116. <span class="phpdocumentor-element__extends">
  117. extends <a href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html"><abbr title="\chillerlan\QRCode\Data\QRDataModeAbstract">QRDataModeAbstract</abbr></a>
  118. </span>
  119. <div class="phpdocumentor-element__package">
  120. in package
  121. <ul class="phpdocumentor-breadcrumbs">
  122. <li class="phpdocumentor-breadcrumb"><a href="packages/Application.html">Application</a></li>
  123. </ul>
  124. </div>
  125. </h2>
  126. <div class="phpdocumentor-label-line">
  127. <div class="phpdocumentor-label phpdocumentor-label--success"><span>Final</span><span>Yes</span></div>
  128. </div>
  129. <aside class="phpdocumentor-element-found-in">
  130. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/Byte.php"><a href="files/src-data-byte.html"><abbr title="src/Data/Byte.php">Byte.php</abbr></a></abbr>
  131. :
  132. <span class="phpdocumentor-element-found-in__line">23</span>
  133. </aside>
  134. <p class="phpdocumentor-summary">8-bit Byte mode, ISO-8859-1 or UTF-8</p>
  135. <section class="phpdocumentor-description"><p>ISO/IEC 18004:2000 Section 8.3.4
  136. ISO/IEC 18004:2000 Section 8.4.4</p>
  137. </section>
  138. <h3 id="toc">
  139. Table of Contents
  140. <a href="classes/chillerlan-QRCode-Data-Byte.html#toc" class="headerlink"><i class="fas fa-link"></i></a>
  141. </h3>
  142. <h4 id="toc-constants">
  143. Constants
  144. <a href="classes/chillerlan-QRCode-Data-Byte.html#toc-constants" class="headerlink"><i class="fas fa-link"></i></a>
  145. </h4>
  146. <dl class="phpdocumentor-table-of-contents">
  147. <dt class="phpdocumentor-table-of-contents__entry -constant -public">
  148. <a class="" href="classes/chillerlan-QRCode-Data-Byte.html#constant_DATAMODE">DATAMODE</a>
  149. <span>
  150. &nbsp;= \chillerlan\QRCode\Common\Mode::BYTE </span>
  151. </dt>
  152. </dl>
  153. <h4 id="toc-properties">
  154. Properties
  155. <a href="classes/chillerlan-QRCode-Data-Byte.html#toc-properties" class="headerlink"><i class="fas fa-link"></i></a>
  156. </h4>
  157. <dl class="phpdocumentor-table-of-contents">
  158. <dt class="phpdocumentor-table-of-contents__entry -property -protected">
  159. <a class="" href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#property_data">$data</a>
  160. <span>
  161. &nbsp;: string </span>
  162. </dt>
  163. <dd>The data to write</dd>
  164. </dl>
  165. <h4 id="toc-methods">
  166. Methods
  167. <a href="classes/chillerlan-QRCode-Data-Byte.html#toc-methods" class="headerlink"><i class="fas fa-link"></i></a>
  168. </h4>
  169. <dl class="phpdocumentor-table-of-contents">
  170. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  171. <a class="" href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#method___construct">__construct()</a>
  172. <span>
  173. &nbsp;: mixed </span>
  174. </dt>
  175. <dd>QRDataModeAbstract constructor.</dd>
  176. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  177. <a class="" href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#method_convertEncoding">convertEncoding()</a>
  178. <span>
  179. &nbsp;: string </span>
  180. </dt>
  181. <dd>encoding conversion helper</dd>
  182. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  183. <a class="" href="classes/chillerlan-QRCode-Data-Byte.html#method_decodeSegment">decodeSegment()</a>
  184. <span>
  185. &nbsp;: string </span>
  186. </dt>
  187. <dd>reads a segment from the BitBuffer and decodes in the current data mode</dd>
  188. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  189. <a class="" href="classes/chillerlan-QRCode-Data-Byte.html#method_getLengthInBits">getLengthInBits()</a>
  190. <span>
  191. &nbsp;: int </span>
  192. </dt>
  193. <dd>retruns the length in bits of the data string</dd>
  194. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  195. <a class="" href="classes/chillerlan-QRCode-Data-Byte.html#method_validateString">validateString()</a>
  196. <span>
  197. &nbsp;: bool </span>
  198. </dt>
  199. <dd>checks if the given string qualifies for the encoder module</dd>
  200. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  201. <a class="" href="classes/chillerlan-QRCode-Data-Byte.html#method_write">write()</a>
  202. <span>
  203. &nbsp;: static </span>
  204. </dt>
  205. <dd>writes the actual data string to the BitBuffer, uses the given version to determine the length bits</dd>
  206. <dt class="phpdocumentor-table-of-contents__entry -method -protected">
  207. <a class="" href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#method_getCharCount">getCharCount()</a>
  208. <span>
  209. &nbsp;: int </span>
  210. </dt>
  211. <dd>returns the character count of the $data string</dd>
  212. <dt class="phpdocumentor-table-of-contents__entry -method -protected">
  213. <a class="" href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#method_getLengthBits">getLengthBits()</a>
  214. <span>
  215. &nbsp;: int </span>
  216. </dt>
  217. <dd>shortcut</dd>
  218. </dl>
  219. <section class="phpdocumentor-constants">
  220. <h3 class="phpdocumentor-elements__header" id="constants">
  221. Constants
  222. <a href="classes/chillerlan-QRCode-Data-Byte.html#constants" class="headerlink"><i class="fas fa-link"></i></a>
  223. </h3>
  224. <article class="phpdocumentor-element -constant -public ">
  225. <h4 class="phpdocumentor-element__name" id="constant_DATAMODE">
  226. DATAMODE
  227. <a href="classes/chillerlan-QRCode-Data-Byte.html#constant_DATAMODE" class="headerlink"><i class="fas fa-link"></i></a>
  228. </h4>
  229. <aside class="phpdocumentor-element-found-in">
  230. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/Byte.php"><a href="files/src-data-byte.html"><abbr title="src/Data/Byte.php">Byte.php</abbr></a></abbr>
  231. :
  232. <span class="phpdocumentor-element-found-in__line">25</span>
  233. </aside>
  234. <code class="phpdocumentor-signature phpdocumentor-code ">
  235. <span class="phpdocumentor-signature__visibility">public</span>
  236. <span class="phpdocumentor-signature__type">mixed</span>
  237. <span class="phpdocumentor-signature__name">DATAMODE</span>
  238. = <span class="phpdocumentor-signature__default-value">\chillerlan\QRCode\Common\Mode::BYTE</span>
  239. </code>
  240. </article>
  241. </section>
  242. <section class="phpdocumentor-properties">
  243. <h3 class="phpdocumentor-elements__header" id="properties">
  244. Properties
  245. <a href="classes/chillerlan-QRCode-Data-Byte.html#properties" class="headerlink"><i class="fas fa-link"></i></a>
  246. </h3>
  247. <article
  248. class="
  249. phpdocumentor-element
  250. -property
  251. -protected
  252. "
  253. >
  254. <h4 class="phpdocumentor-element__name" id="property_data">
  255. $data
  256. <a href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#property_data" class="headerlink"><i class="fas fa-link"></i></a>
  257. <span class="phpdocumentor-element__modifiers">
  258. </span>
  259. </h4>
  260. <aside class="phpdocumentor-element-found-in">
  261. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/QRDataModeAbstract.php"><a href="files/src-data-qrdatamodeabstract.html"><abbr title="src/Data/QRDataModeAbstract.php">QRDataModeAbstract.php</abbr></a></abbr>
  262. :
  263. <span class="phpdocumentor-element-found-in__line">24</span>
  264. </aside>
  265. <p class="phpdocumentor-summary">The data to write</p>
  266. <code class="phpdocumentor-code phpdocumentor-signature ">
  267. <span class="phpdocumentor-signature__visibility">protected</span>
  268. <span class="phpdocumentor-signature__type">string</span>
  269. <span class="phpdocumentor-signature__name">$data</span>
  270. </code>
  271. </article>
  272. </section>
  273. <section class="phpdocumentor-methods">
  274. <h3 class="phpdocumentor-elements__header" id="methods">
  275. Methods
  276. <a href="classes/chillerlan-QRCode-Data-Byte.html#methods" class="headerlink"><i class="fas fa-link"></i></a>
  277. </h3>
  278. <article
  279. class="phpdocumentor-element
  280. -method
  281. -public
  282. "
  283. >
  284. <h4 class="phpdocumentor-element__name" id="method___construct">
  285. __construct()
  286. <a href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#method___construct" class="headerlink"><i class="fas fa-link"></i></a>
  287. </h4>
  288. <aside class="phpdocumentor-element-found-in">
  289. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/QRDataModeAbstract.php"><a href="files/src-data-qrdatamodeabstract.html"><abbr title="src/Data/QRDataModeAbstract.php">QRDataModeAbstract.php</abbr></a></abbr>
  290. :
  291. <span class="phpdocumentor-element-found-in__line">31</span>
  292. </aside>
  293. <p class="phpdocumentor-summary">QRDataModeAbstract constructor.</p>
  294. <code class="phpdocumentor-code phpdocumentor-signature ">
  295. <span class="phpdocumentor-signature__visibility">public</span>
  296. <span class="phpdocumentor-signature__name">__construct</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$data</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code>
  297. <div class="phpdocumentor-label-line">
  298. </div>
  299. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  300. <dl class="phpdocumentor-argument-list">
  301. <dt class="phpdocumentor-argument-list__entry">
  302. <span class="phpdocumentor-signature__argument__name">$data</span>
  303. : <span class="phpdocumentor-signature__argument__return-type">string</span>
  304. </dt>
  305. <dd class="phpdocumentor-argument-list__definition">
  306. </dd>
  307. </dl>
  308. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  309. Tags
  310. <a href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#method___construct#tags" class="headerlink"><i class="fas fa-link"></i></a>
  311. </h5>
  312. <dl class="phpdocumentor-tag-list">
  313. <dt class="phpdocumentor-tag-list__entry">
  314. <span class="phpdocumentor-tag__name">throws</span>
  315. </dt>
  316. <dd class="phpdocumentor-tag-list__definition">
  317. <span class="phpdocumentor-tag-link"><a href="classes/chillerlan-QRCode-Data-QRCodeDataException.html"><abbr title="\chillerlan\QRCode\Data\QRCodeDataException">QRCodeDataException</abbr></a></span>
  318. </dd>
  319. </dl>
  320. </article>
  321. <article
  322. class="phpdocumentor-element
  323. -method
  324. -public
  325. -static "
  326. >
  327. <h4 class="phpdocumentor-element__name" id="method_convertEncoding">
  328. convertEncoding()
  329. <a href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#method_convertEncoding" class="headerlink"><i class="fas fa-link"></i></a>
  330. </h4>
  331. <aside class="phpdocumentor-element-found-in">
  332. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/QRDataModeAbstract.php"><a href="files/src-data-qrdatamodeabstract.html"><abbr title="src/Data/QRDataModeAbstract.php">QRDataModeAbstract.php</abbr></a></abbr>
  333. :
  334. <span class="phpdocumentor-element-found-in__line">48</span>
  335. </aside>
  336. <p class="phpdocumentor-summary">encoding conversion helper</p>
  337. <code class="phpdocumentor-code phpdocumentor-signature ">
  338. <span class="phpdocumentor-signature__visibility">public</span>
  339. <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>
  340. <div class="phpdocumentor-label-line">
  341. </div>
  342. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  343. <dl class="phpdocumentor-argument-list">
  344. <dt class="phpdocumentor-argument-list__entry">
  345. <span class="phpdocumentor-signature__argument__name">$string</span>
  346. : <span class="phpdocumentor-signature__argument__return-type">string</span>
  347. </dt>
  348. <dd class="phpdocumentor-argument-list__definition">
  349. </dd>
  350. </dl>
  351. <section>
  352. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  353. <span class="phpdocumentor-signature__response_type">string</span>
  354. </section>
  355. </article>
  356. <article
  357. class="phpdocumentor-element
  358. -method
  359. -public
  360. -static "
  361. >
  362. <h4 class="phpdocumentor-element__name" id="method_decodeSegment">
  363. decodeSegment()
  364. <a href="classes/chillerlan-QRCode-Data-Byte.html#method_decodeSegment" class="headerlink"><i class="fas fa-link"></i></a>
  365. </h4>
  366. <aside class="phpdocumentor-element-found-in">
  367. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/Byte.php"><a href="files/src-data-byte.html"><abbr title="src/Data/Byte.php">Byte.php</abbr></a></abbr>
  368. :
  369. <span class="phpdocumentor-element-found-in__line">58</span>
  370. </aside>
  371. <p class="phpdocumentor-summary">reads a segment from the BitBuffer and decodes in the current data mode</p>
  372. <code class="phpdocumentor-code phpdocumentor-signature ">
  373. <span class="phpdocumentor-signature__visibility">public</span>
  374. <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>
  375. <div class="phpdocumentor-label-line">
  376. </div>
  377. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  378. <dl class="phpdocumentor-argument-list">
  379. <dt class="phpdocumentor-argument-list__entry">
  380. <span class="phpdocumentor-signature__argument__name">$bitBuffer</span>
  381. : <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>
  382. </dt>
  383. <dd class="phpdocumentor-argument-list__definition">
  384. </dd>
  385. <dt class="phpdocumentor-argument-list__entry">
  386. <span class="phpdocumentor-signature__argument__name">$versionNumber</span>
  387. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  388. </dt>
  389. <dd class="phpdocumentor-argument-list__definition">
  390. </dd>
  391. </dl>
  392. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  393. Tags
  394. <a href="classes/chillerlan-QRCode-Data-Byte.html#method_decodeSegment#tags" class="headerlink"><i class="fas fa-link"></i></a>
  395. </h5>
  396. <dl class="phpdocumentor-tag-list">
  397. <dt class="phpdocumentor-tag-list__entry">
  398. <span class="phpdocumentor-tag__name">inheritDoc</span>
  399. </dt>
  400. <dd class="phpdocumentor-tag-list__definition">
  401. </dd>
  402. <dt class="phpdocumentor-tag-list__entry">
  403. <span class="phpdocumentor-tag__name">throws</span>
  404. </dt>
  405. <dd class="phpdocumentor-tag-list__definition">
  406. <span class="phpdocumentor-tag-link"><a href="classes/chillerlan-QRCode-Data-QRCodeDataException.html"><abbr title="\chillerlan\QRCode\Data\QRCodeDataException">QRCodeDataException</abbr></a></span>
  407. </dd>
  408. </dl>
  409. <section>
  410. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  411. <span class="phpdocumentor-signature__response_type">string</span>
  412. </section>
  413. </article>
  414. <article
  415. class="phpdocumentor-element
  416. -method
  417. -public
  418. "
  419. >
  420. <h4 class="phpdocumentor-element__name" id="method_getLengthInBits">
  421. getLengthInBits()
  422. <a href="classes/chillerlan-QRCode-Data-Byte.html#method_getLengthInBits" class="headerlink"><i class="fas fa-link"></i></a>
  423. </h4>
  424. <aside class="phpdocumentor-element-found-in">
  425. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/Byte.php"><a href="files/src-data-byte.html"><abbr title="src/Data/Byte.php">Byte.php</abbr></a></abbr>
  426. :
  427. <span class="phpdocumentor-element-found-in__line">27</span>
  428. </aside>
  429. <p class="phpdocumentor-summary">retruns the length in bits of the data string</p>
  430. <code class="phpdocumentor-code phpdocumentor-signature ">
  431. <span class="phpdocumentor-signature__visibility">public</span>
  432. <span class="phpdocumentor-signature__name">getLengthInBits</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">int</span></code>
  433. <div class="phpdocumentor-label-line">
  434. </div>
  435. <section>
  436. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  437. <span class="phpdocumentor-signature__response_type">int</span>
  438. </section>
  439. </article>
  440. <article
  441. class="phpdocumentor-element
  442. -method
  443. -public
  444. -static "
  445. >
  446. <h4 class="phpdocumentor-element__name" id="method_validateString">
  447. validateString()
  448. <a href="classes/chillerlan-QRCode-Data-Byte.html#method_validateString" class="headerlink"><i class="fas fa-link"></i></a>
  449. </h4>
  450. <aside class="phpdocumentor-element-found-in">
  451. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/Byte.php"><a href="files/src-data-byte.html"><abbr title="src/Data/Byte.php">Byte.php</abbr></a></abbr>
  452. :
  453. <span class="phpdocumentor-element-found-in__line">31</span>
  454. </aside>
  455. <p class="phpdocumentor-summary">checks if the given string qualifies for the encoder module</p>
  456. <code class="phpdocumentor-code phpdocumentor-signature ">
  457. <span class="phpdocumentor-signature__visibility">public</span>
  458. <span class="phpdocumentor-signature__static">static</span> <span class="phpdocumentor-signature__name">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>
  459. <div class="phpdocumentor-label-line">
  460. </div>
  461. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  462. <dl class="phpdocumentor-argument-list">
  463. <dt class="phpdocumentor-argument-list__entry">
  464. <span class="phpdocumentor-signature__argument__name">$string</span>
  465. : <span class="phpdocumentor-signature__argument__return-type">string</span>
  466. </dt>
  467. <dd class="phpdocumentor-argument-list__definition">
  468. </dd>
  469. </dl>
  470. <section>
  471. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  472. <span class="phpdocumentor-signature__response_type">bool</span>
  473. </section>
  474. </article>
  475. <article
  476. class="phpdocumentor-element
  477. -method
  478. -public
  479. "
  480. >
  481. <h4 class="phpdocumentor-element__name" id="method_write">
  482. write()
  483. <a href="classes/chillerlan-QRCode-Data-Byte.html#method_write" class="headerlink"><i class="fas fa-link"></i></a>
  484. </h4>
  485. <aside class="phpdocumentor-element-found-in">
  486. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/Byte.php"><a href="files/src-data-byte.html"><abbr title="src/Data/Byte.php">Byte.php</abbr></a></abbr>
  487. :
  488. <span class="phpdocumentor-element-found-in__line">35</span>
  489. </aside>
  490. <p class="phpdocumentor-summary">writes the actual data string to the BitBuffer, uses the given version to determine the length bits</p>
  491. <code class="phpdocumentor-code phpdocumentor-signature ">
  492. <span class="phpdocumentor-signature__visibility">public</span>
  493. <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>
  494. <div class="phpdocumentor-label-line">
  495. </div>
  496. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  497. <dl class="phpdocumentor-argument-list">
  498. <dt class="phpdocumentor-argument-list__entry">
  499. <span class="phpdocumentor-signature__argument__name">$bitBuffer</span>
  500. : <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>
  501. </dt>
  502. <dd class="phpdocumentor-argument-list__definition">
  503. </dd>
  504. <dt class="phpdocumentor-argument-list__entry">
  505. <span class="phpdocumentor-signature__argument__name">$versionNumber</span>
  506. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  507. </dt>
  508. <dd class="phpdocumentor-argument-list__definition">
  509. </dd>
  510. </dl>
  511. <section>
  512. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  513. <span class="phpdocumentor-signature__response_type">static</span>
  514. </section>
  515. </article>
  516. <article
  517. class="phpdocumentor-element
  518. -method
  519. -protected
  520. "
  521. >
  522. <h4 class="phpdocumentor-element__name" id="method_getCharCount">
  523. getCharCount()
  524. <a href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#method_getCharCount" class="headerlink"><i class="fas fa-link"></i></a>
  525. </h4>
  526. <aside class="phpdocumentor-element-found-in">
  527. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/QRDataModeAbstract.php"><a href="files/src-data-qrdatamodeabstract.html"><abbr title="src/Data/QRDataModeAbstract.php">QRDataModeAbstract.php</abbr></a></abbr>
  528. :
  529. <span class="phpdocumentor-element-found-in__line">44</span>
  530. </aside>
  531. <p class="phpdocumentor-summary">returns the character count of the $data string</p>
  532. <code class="phpdocumentor-code phpdocumentor-signature ">
  533. <span class="phpdocumentor-signature__visibility">protected</span>
  534. <span class="phpdocumentor-signature__name">getCharCount</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">int</span></code>
  535. <div class="phpdocumentor-label-line">
  536. </div>
  537. <section>
  538. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  539. <span class="phpdocumentor-signature__response_type">int</span>
  540. </section>
  541. </article>
  542. <article
  543. class="phpdocumentor-element
  544. -method
  545. -protected
  546. -static "
  547. >
  548. <h4 class="phpdocumentor-element__name" id="method_getLengthBits">
  549. getLengthBits()
  550. <a href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#method_getLengthBits" class="headerlink"><i class="fas fa-link"></i></a>
  551. </h4>
  552. <aside class="phpdocumentor-element-found-in">
  553. <abbr class="phpdocumentor-element-found-in__file" title="src/Data/QRDataModeAbstract.php"><a href="files/src-data-qrdatamodeabstract.html"><abbr title="src/Data/QRDataModeAbstract.php">QRDataModeAbstract.php</abbr></a></abbr>
  554. :
  555. <span class="phpdocumentor-element-found-in__line">55</span>
  556. </aside>
  557. <p class="phpdocumentor-summary">shortcut</p>
  558. <code class="phpdocumentor-code phpdocumentor-signature ">
  559. <span class="phpdocumentor-signature__visibility">protected</span>
  560. <span class="phpdocumentor-signature__static">static</span> <span class="phpdocumentor-signature__name">getLengthBits</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$versionNumber</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">int</span></code>
  561. <div class="phpdocumentor-label-line">
  562. </div>
  563. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  564. <dl class="phpdocumentor-argument-list">
  565. <dt class="phpdocumentor-argument-list__entry">
  566. <span class="phpdocumentor-signature__argument__name">$versionNumber</span>
  567. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  568. </dt>
  569. <dd class="phpdocumentor-argument-list__definition">
  570. </dd>
  571. </dl>
  572. <section>
  573. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  574. <span class="phpdocumentor-signature__response_type">int</span>
  575. </section>
  576. </article>
  577. </section>
  578. <div class="phpdocumentor-modal" id="source-view">
  579. <div class="phpdocumentor-modal-bg" data-exit-button></div>
  580. <div class="phpdocumentor-modal-container">
  581. <div class="phpdocumentor-modal-content">
  582. <pre style="max-height: 500px; overflow-y: scroll" data-src="files/src/Data/Byte.php.txt" class="language-php line-numbers linkable-line-numbers"></pre>
  583. </div>
  584. <button data-exit-button class="phpdocumentor-modal__close">&times;</button>
  585. </div>
  586. </div>
  587. <script type="text/javascript">
  588. (function () {
  589. function loadExternalCodeSnippet(el, url, line) {
  590. Array.prototype.slice.call(el.querySelectorAll('pre[data-src]')).forEach((pre) => {
  591. const src = url || pre.getAttribute('data-src').replace(/\\/g, '/');
  592. const language = 'php';
  593. const code = document.createElement('code');
  594. code.className = 'language-' + language;
  595. pre.textContent = '';
  596. pre.setAttribute('data-line', line)
  597. code.textContent = 'Loading…';
  598. pre.appendChild(code);
  599. var xhr = new XMLHttpRequest();
  600. xhr.open('GET', src, true);
  601. xhr.onreadystatechange = function () {
  602. if (xhr.readyState !== 4) {
  603. return;
  604. }
  605. if (xhr.status < 400 && xhr.responseText) {
  606. code.textContent = xhr.responseText;
  607. Prism.highlightElement(code);
  608. return;
  609. }
  610. if (xhr.status === 404) {
  611. code.textContent = '✖ Error: File could not be found';
  612. return;
  613. }
  614. if (xhr.status >= 400) {
  615. code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
  616. return;
  617. }
  618. code.textContent = '✖ Error: An unknown error occurred';
  619. };
  620. xhr.send(null);
  621. });
  622. }
  623. const modalButtons = document.querySelectorAll("[data-modal]");
  624. const openedAsLocalFile = window.location.protocol === 'file:';
  625. if (modalButtons.length > 0 && openedAsLocalFile) {
  626. console.warn(
  627. 'Viewing the source code is unavailable because you are opening this page from the file:// scheme; ' +
  628. 'browsers block XHR requests when a page is opened this way'
  629. );
  630. }
  631. modalButtons.forEach(function (trigger) {
  632. if (openedAsLocalFile) {
  633. trigger.setAttribute("hidden", "hidden");
  634. }
  635. trigger.addEventListener("click", function (event) {
  636. event.preventDefault();
  637. const modal = document.getElementById(trigger.dataset.modal);
  638. if (!modal) {
  639. console.error(`Modal with id "${trigger.dataset.modal}" could not be found`);
  640. return;
  641. }
  642. modal.classList.add("phpdocumentor-modal__open");
  643. loadExternalCodeSnippet(modal, trigger.dataset.src || null, trigger.dataset.line)
  644. const exits = modal.querySelectorAll("[data-exit-button]");
  645. exits.forEach(function (exit) {
  646. exit.addEventListener("click", function (event) {
  647. event.preventDefault();
  648. modal.classList.remove("phpdocumentor-modal__open");
  649. });
  650. });
  651. });
  652. });
  653. })();
  654. </script>
  655. </article>
  656. </section>
  657. <section class="phpdocumentor-on-this-page__sidebar">
  658. <section class="phpdocumentor-on-this-page__content">
  659. <strong class="phpdocumentor-on-this-page__title">On this page</strong>
  660. <ul class="phpdocumentor-list -clean">
  661. <li class="phpdocumentor-on-this-page-section__title">Table Of Contents</li>
  662. <li>
  663. <ul class="phpdocumentor-list -clean">
  664. <li><a href="classes/chillerlan-QRCode-Data-Byte.html#toc-constants">Constants</a></li>
  665. <li><a href="classes/chillerlan-QRCode-Data-Byte.html#toc-properties">Properties</a></li>
  666. <li><a href="classes/chillerlan-QRCode-Data-Byte.html#toc-methods">Methods</a></li>
  667. </ul>
  668. </li>
  669. <li class="phpdocumentor-on-this-page-section__title">Constants</li>
  670. <li>
  671. <ul class="phpdocumentor-list -clean">
  672. <li class=""><a href="classes/chillerlan-QRCode-Data-Byte.html#constant_DATAMODE">DATAMODE</a></li>
  673. </ul>
  674. </li>
  675. <li class="phpdocumentor-on-this-page-section__title">Properties</li>
  676. <li>
  677. <ul class="phpdocumentor-list -clean">
  678. <li class=""><a href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#property_data">$data</a></li>
  679. </ul>
  680. </li>
  681. <li class="phpdocumentor-on-this-page-section__title">Methods</li>
  682. <li>
  683. <ul class="phpdocumentor-list -clean">
  684. <li class=""><a href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#method___construct">__construct()</a></li>
  685. <li class=""><a href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#method_convertEncoding">convertEncoding()</a></li>
  686. <li class=""><a href="classes/chillerlan-QRCode-Data-Byte.html#method_decodeSegment">decodeSegment()</a></li>
  687. <li class=""><a href="classes/chillerlan-QRCode-Data-Byte.html#method_getLengthInBits">getLengthInBits()</a></li>
  688. <li class=""><a href="classes/chillerlan-QRCode-Data-Byte.html#method_validateString">validateString()</a></li>
  689. <li class=""><a href="classes/chillerlan-QRCode-Data-Byte.html#method_write">write()</a></li>
  690. <li class=""><a href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#method_getCharCount">getCharCount()</a></li>
  691. <li class=""><a href="classes/chillerlan-QRCode-Data-QRDataModeAbstract.html#method_getLengthBits">getLengthBits()</a></li>
  692. </ul>
  693. </li>
  694. </ul>
  695. </section>
  696. </section>
  697. </div>
  698. <section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
  699. <section class="phpdocumentor-search-results__dialog">
  700. <header class="phpdocumentor-search-results__header">
  701. <h2 class="phpdocumentor-search-results__title">Search results</h2>
  702. <button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
  703. </header>
  704. <section class="phpdocumentor-search-results__body">
  705. <ul class="phpdocumentor-search-results__entries"></ul>
  706. </section>
  707. </section>
  708. </section>
  709. </div>
  710. <a href="classes/chillerlan-QRCode-Data-Byte.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
  711. </main>
  712. <script>
  713. cssVars({});
  714. </script>
  715. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
  716. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
  717. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
  718. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
  719. </body>
  720. </html>