chillerlan-QRCode-Common-BitBuffer.html 44 KB

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