chillerlan-QRCode-Common-BitBuffer.html 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050
  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>