chillerlan-QRCode-Common-BitBuffer.html 44 KB

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