chillerlan-QRCode-Common-BitBuffer.html 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867
  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=Source+Sans+Pro:wght@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/search.js"></script>
  22. <script defer src="js/searchIndex.js"></script>
  23. </head>
  24. <body id="top">
  25. <header class="phpdocumentor-header phpdocumentor-section">
  26. <h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">Documentation</a></h1>
  27. <input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
  28. <label class="phpdocumentor-header__menu-icon" for="menu-button">
  29. <i class="fas fa-bars"></i>
  30. </label>
  31. <section data-search-form class="phpdocumentor-search">
  32. <label>
  33. <span class="visually-hidden">Search for</span>
  34. <svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
  35. <circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
  36. <line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
  37. </svg>
  38. <input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
  39. </label>
  40. </section>
  41. <nav class="phpdocumentor-topnav">
  42. <ul class="phpdocumentor-topnav__menu">
  43. <li class="phpdocumentor-topnav__menu-item -menu">
  44. <a href="https://php-qrcode.readthedocs.io">
  45. <span>
  46. User Manual
  47. </span>
  48. </a>
  49. </li>
  50. <li class="phpdocumentor-topnav__menu-item -social">
  51. <a href="https://github.com/chillerlan/php-qrcode">
  52. <span>
  53. <i class="fab fa-github"></i>
  54. </span>
  55. </a>
  56. </li>
  57. </ul>
  58. </nav>
  59. </header>
  60. <main class="phpdocumentor">
  61. <div class="phpdocumentor-section">
  62. <input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
  63. <label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
  64. Menu
  65. </label>
  66. <aside class="phpdocumentor-column -four phpdocumentor-sidebar">
  67. <section class="phpdocumentor-sidebar__category">
  68. <h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
  69. <h4 class="phpdocumentor-sidebar__root-namespace">
  70. <a href="namespaces/chillerlan.html" class="">chillerlan</a>
  71. </h4>
  72. <ul class="phpdocumentor-list">
  73. <li>
  74. <a href="namespaces/chillerlan-qrcode.html" class="">QRCode</a>
  75. </li>
  76. <li>
  77. <a href="namespaces/chillerlan-qrcodetest.html" class="">QRCodeTest</a>
  78. </li>
  79. </ul>
  80. </section>
  81. <section class="phpdocumentor-sidebar__category">
  82. <h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
  83. <h4 class="phpdocumentor-sidebar__root-namespace">
  84. <a href="packages/Application.html" class="">Application</a>
  85. </h4>
  86. </section>
  87. <section class="phpdocumentor-sidebar__category">
  88. <h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
  89. <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
  90. <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
  91. <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
  92. </section>
  93. <section class="phpdocumentor-sidebar__category">
  94. <h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
  95. <h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
  96. </section>
  97. </aside>
  98. <div class="phpdocumentor-column -eight phpdocumentor-content">
  99. <ul class="phpdocumentor-breadcrumbs">
  100. <li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan.html">chillerlan</a></li>
  101. <li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan-qrcode.html">QRCode</a></li>
  102. <li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan-qrcode-common.html">Common</a></li>
  103. </ul>
  104. <article class="phpdocumentor-element -class">
  105. <h2 class="phpdocumentor-content__title">
  106. BitBuffer
  107. <div class="phpdocumentor-element__package">
  108. in package
  109. <ul class="phpdocumentor-breadcrumbs">
  110. <li class="phpdocumentor-breadcrumb"><a href="packages/Application.html">Application</a></li>
  111. </ul>
  112. </div>
  113. </h2>
  114. <aside class="phpdocumentor-element-found-in">
  115. <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>
  116. :
  117. <span class="phpdocumentor-element-found-in__line">19</span>
  118. </aside>
  119. <p class="phpdocumentor-summary">Holds the raw binary data</p>
  120. <h3 id="toc">
  121. Table of Contents
  122. <a href="#toc" class="headerlink"><i class="fas fa-link"></i></a>
  123. </h3>
  124. <dl class="phpdocumentor-table-of-contents">
  125. <dt class="phpdocumentor-table-of-contents__entry -property -private">
  126. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#property_bitsRead">$bitsRead</a>
  127. <span>
  128. &nbsp;: int </span>
  129. </dt>
  130. <dd>Read count (bits)</dd>
  131. <dt class="phpdocumentor-table-of-contents__entry -property -private">
  132. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#property_buffer">$buffer</a>
  133. <span>
  134. &nbsp;: array&lt;string|int, mixed&gt; </span>
  135. </dt>
  136. <dd>The buffer content</dd>
  137. <dt class="phpdocumentor-table-of-contents__entry -property -private">
  138. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#property_bytesRead">$bytesRead</a>
  139. <span>
  140. &nbsp;: int </span>
  141. </dt>
  142. <dd>Read count (bytes)</dd>
  143. <dt class="phpdocumentor-table-of-contents__entry -property -private">
  144. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#property_length">$length</a>
  145. <span>
  146. &nbsp;: int </span>
  147. </dt>
  148. <dd>Length of the content (bits)</dd>
  149. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  150. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method___construct">__construct()</a>
  151. <span>
  152. &nbsp;: mixed </span>
  153. </dt>
  154. <dd>BitBuffer constructor.</dd>
  155. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  156. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_available">available()</a>
  157. <span>
  158. &nbsp;: int </span>
  159. </dt>
  160. <dd></dd>
  161. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  162. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_clear">clear()</a>
  163. <span>
  164. &nbsp;: self </span>
  165. </dt>
  166. <dd>Clears the buffer and resets the stats</dd>
  167. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  168. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_getBuffer">getBuffer()</a>
  169. <span>
  170. &nbsp;: array&lt;string|int, mixed&gt; </span>
  171. </dt>
  172. <dd>returns the buffer content</dd>
  173. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  174. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_getLength">getLength()</a>
  175. <span>
  176. &nbsp;: int </span>
  177. </dt>
  178. <dd>returns the current buffer length</dd>
  179. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  180. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_put">put()</a>
  181. <span>
  182. &nbsp;: self </span>
  183. </dt>
  184. <dd>appends a sequence of bits</dd>
  185. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  186. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_putBit">putBit()</a>
  187. <span>
  188. &nbsp;: self </span>
  189. </dt>
  190. <dd>appends a single bit</dd>
  191. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  192. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_read">read()</a>
  193. <span>
  194. &nbsp;: int </span>
  195. </dt>
  196. <dd></dd>
  197. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  198. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_rewind">rewind()</a>
  199. <span>
  200. &nbsp;: self </span>
  201. </dt>
  202. <dd>Resets the read-counters</dd>
  203. </dl>
  204. <section class="phpdocumentor-properties">
  205. <h3 class="phpdocumentor-elements__header" id="properties">
  206. Properties
  207. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#properties" class="headerlink"><i class="fas fa-link"></i></a>
  208. </h3>
  209. <article
  210. class="
  211. phpdocumentor-element
  212. -property
  213. -private
  214. "
  215. >
  216. <h4 class="phpdocumentor-element__name" id="property_bitsRead">
  217. $bitsRead
  218. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#property_bitsRead" class="headerlink"><i class="fas fa-link"></i></a>
  219. <span class="phpdocumentor-element__modifiers">
  220. </span>
  221. </h4>
  222. <aside class="phpdocumentor-element-found-in">
  223. <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>
  224. :
  225. <span class="phpdocumentor-element-found-in__line">41</span>
  226. </aside>
  227. <p class="phpdocumentor-summary">Read count (bits)</p>
  228. <code class="phpdocumentor-code phpdocumentor-signature ">
  229. <span class="phpdocumentor-signature__visibility">private</span>
  230. <span class="phpdocumentor-signature__type">int</span>
  231. <span class="phpdocumentor-signature__name">$bitsRead</span>
  232. = <span class="phpdocumentor-signature__default-value">0</span></code>
  233. <section class="phpdocumentor-description"></section>
  234. </article>
  235. <article
  236. class="
  237. phpdocumentor-element
  238. -property
  239. -private
  240. "
  241. >
  242. <h4 class="phpdocumentor-element__name" id="property_buffer">
  243. $buffer
  244. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#property_buffer" class="headerlink"><i class="fas fa-link"></i></a>
  245. <span class="phpdocumentor-element__modifiers">
  246. </span>
  247. </h4>
  248. <aside class="phpdocumentor-element-found-in">
  249. <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>
  250. :
  251. <span class="phpdocumentor-element-found-in__line">26</span>
  252. </aside>
  253. <p class="phpdocumentor-summary">The buffer content</p>
  254. <code class="phpdocumentor-code phpdocumentor-signature ">
  255. <span class="phpdocumentor-signature__visibility">private</span>
  256. <span class="phpdocumentor-signature__type">array&lt;string|int, mixed&gt;</span>
  257. <span class="phpdocumentor-signature__name">$buffer</span>
  258. </code>
  259. </article>
  260. <article
  261. class="
  262. phpdocumentor-element
  263. -property
  264. -private
  265. "
  266. >
  267. <h4 class="phpdocumentor-element__name" id="property_bytesRead">
  268. $bytesRead
  269. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#property_bytesRead" class="headerlink"><i class="fas fa-link"></i></a>
  270. <span class="phpdocumentor-element__modifiers">
  271. </span>
  272. </h4>
  273. <aside class="phpdocumentor-element-found-in">
  274. <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>
  275. :
  276. <span class="phpdocumentor-element-found-in__line">36</span>
  277. </aside>
  278. <p class="phpdocumentor-summary">Read count (bytes)</p>
  279. <code class="phpdocumentor-code phpdocumentor-signature ">
  280. <span class="phpdocumentor-signature__visibility">private</span>
  281. <span class="phpdocumentor-signature__type">int</span>
  282. <span class="phpdocumentor-signature__name">$bytesRead</span>
  283. = <span class="phpdocumentor-signature__default-value">0</span></code>
  284. <section class="phpdocumentor-description"></section>
  285. </article>
  286. <article
  287. class="
  288. phpdocumentor-element
  289. -property
  290. -private
  291. "
  292. >
  293. <h4 class="phpdocumentor-element__name" id="property_length">
  294. $length
  295. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#property_length" class="headerlink"><i class="fas fa-link"></i></a>
  296. <span class="phpdocumentor-element__modifiers">
  297. </span>
  298. </h4>
  299. <aside class="phpdocumentor-element-found-in">
  300. <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>
  301. :
  302. <span class="phpdocumentor-element-found-in__line">31</span>
  303. </aside>
  304. <p class="phpdocumentor-summary">Length of the content (bits)</p>
  305. <code class="phpdocumentor-code phpdocumentor-signature ">
  306. <span class="phpdocumentor-signature__visibility">private</span>
  307. <span class="phpdocumentor-signature__type">int</span>
  308. <span class="phpdocumentor-signature__name">$length</span>
  309. </code>
  310. <section class="phpdocumentor-description"></section>
  311. </article>
  312. </section>
  313. <section class="phpdocumentor-methods">
  314. <h3 class="phpdocumentor-elements__header" id="methods">
  315. Methods
  316. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#methods" class="headerlink"><i class="fas fa-link"></i></a>
  317. </h3>
  318. <article
  319. class="phpdocumentor-element
  320. -method
  321. -public
  322. "
  323. >
  324. <h4 class="phpdocumentor-element__name" id="method___construct">
  325. __construct()
  326. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method___construct" class="headerlink"><i class="fas fa-link"></i></a>
  327. </h4>
  328. <aside class="phpdocumentor-element-found-in">
  329. <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>
  330. :
  331. <span class="phpdocumentor-element-found-in__line">48</span>
  332. </aside>
  333. <p class="phpdocumentor-summary">BitBuffer constructor.</p>
  334. <code class="phpdocumentor-code phpdocumentor-signature ">
  335. <span class="phpdocumentor-signature__visibility">public</span>
  336. <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;|null&nbsp;</span><span class="phpdocumentor-signature__argument__name">$bytes</span><span> = </span><span class="phpdocumentor-signature__argument__default-value">null</span><span> ]</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code>
  337. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  338. <dl class="phpdocumentor-argument-list">
  339. <dt class="phpdocumentor-argument-list__entry">
  340. <span class="phpdocumentor-signature__argument__name">$bytes</span>
  341. : <span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, int&gt;|null</span>
  342. = <span class="phpdocumentor-signature__argument__default-value">null</span> </dt>
  343. <dd class="phpdocumentor-argument-list__definition">
  344. </dd>
  345. </dl>
  346. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  347. <span class="phpdocumentor-signature__response_type">mixed</span>
  348. &mdash;
  349. </article>
  350. <article
  351. class="phpdocumentor-element
  352. -method
  353. -public
  354. "
  355. >
  356. <h4 class="phpdocumentor-element__name" id="method_available">
  357. available()
  358. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_available" class="headerlink"><i class="fas fa-link"></i></a>
  359. </h4>
  360. <aside class="phpdocumentor-element-found-in">
  361. <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>
  362. :
  363. <span class="phpdocumentor-element-found-in__line">103</span>
  364. </aside>
  365. <code class="phpdocumentor-code phpdocumentor-signature ">
  366. <span class="phpdocumentor-signature__visibility">public</span>
  367. <span class="phpdocumentor-signature__name">available</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">int</span></code>
  368. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  369. <span class="phpdocumentor-signature__response_type">int</span>
  370. &mdash;
  371. <section class="phpdocumentor-description"><p>number of bits that can be read successfully</p>
  372. </section>
  373. </article>
  374. <article
  375. class="phpdocumentor-element
  376. -method
  377. -public
  378. "
  379. >
  380. <h4 class="phpdocumentor-element__name" id="method_clear">
  381. clear()
  382. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_clear" class="headerlink"><i class="fas fa-link"></i></a>
  383. </h4>
  384. <aside class="phpdocumentor-element-found-in">
  385. <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>
  386. :
  387. <span class="phpdocumentor-element-found-in__line">163</span>
  388. </aside>
  389. <p class="phpdocumentor-summary">Clears the buffer and resets the stats</p>
  390. <code class="phpdocumentor-code phpdocumentor-signature ">
  391. <span class="phpdocumentor-signature__visibility">public</span>
  392. <span class="phpdocumentor-signature__name">clear</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
  393. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  394. <span class="phpdocumentor-signature__response_type">self</span>
  395. &mdash;
  396. </article>
  397. <article
  398. class="phpdocumentor-element
  399. -method
  400. -public
  401. "
  402. >
  403. <h4 class="phpdocumentor-element__name" id="method_getBuffer">
  404. getBuffer()
  405. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_getBuffer" 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">96</span>
  411. </aside>
  412. <p class="phpdocumentor-summary">returns the buffer content</p>
  413. <code class="phpdocumentor-code phpdocumentor-signature ">
  414. <span class="phpdocumentor-signature__visibility">public</span>
  415. <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>
  416. <section class="phpdocumentor-description"><p>to debug: array_map(fn($v) =&gt; sprintf('%08b', $v), $bitBuffer-&gt;getBuffer())</p>
  417. </section>
  418. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  419. <span class="phpdocumentor-signature__response_type">array&lt;string|int, mixed&gt;</span>
  420. &mdash;
  421. </article>
  422. <article
  423. class="phpdocumentor-element
  424. -method
  425. -public
  426. "
  427. >
  428. <h4 class="phpdocumentor-element__name" id="method_getLength">
  429. getLength()
  430. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_getLength" class="headerlink"><i class="fas fa-link"></i></a>
  431. </h4>
  432. <aside class="phpdocumentor-element-found-in">
  433. <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>
  434. :
  435. <span class="phpdocumentor-element-found-in__line">87</span>
  436. </aside>
  437. <p class="phpdocumentor-summary">returns the current buffer length</p>
  438. <code class="phpdocumentor-code phpdocumentor-signature ">
  439. <span class="phpdocumentor-signature__visibility">public</span>
  440. <span class="phpdocumentor-signature__name">getLength</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">int</span></code>
  441. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  442. <span class="phpdocumentor-signature__response_type">int</span>
  443. &mdash;
  444. </article>
  445. <article
  446. class="phpdocumentor-element
  447. -method
  448. -public
  449. "
  450. >
  451. <h4 class="phpdocumentor-element__name" id="method_put">
  452. put()
  453. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_put" class="headerlink"><i class="fas fa-link"></i></a>
  454. </h4>
  455. <aside class="phpdocumentor-element-found-in">
  456. <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>
  457. :
  458. <span class="phpdocumentor-element-found-in__line">56</span>
  459. </aside>
  460. <p class="phpdocumentor-summary">appends a sequence of bits</p>
  461. <code class="phpdocumentor-code phpdocumentor-signature ">
  462. <span class="phpdocumentor-signature__visibility">public</span>
  463. <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>
  464. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  465. <dl class="phpdocumentor-argument-list">
  466. <dt class="phpdocumentor-argument-list__entry">
  467. <span class="phpdocumentor-signature__argument__name">$bits</span>
  468. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  469. </dt>
  470. <dd class="phpdocumentor-argument-list__definition">
  471. <section class="phpdocumentor-description"></section>
  472. </dd>
  473. <dt class="phpdocumentor-argument-list__entry">
  474. <span class="phpdocumentor-signature__argument__name">$length</span>
  475. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  476. </dt>
  477. <dd class="phpdocumentor-argument-list__definition">
  478. <section class="phpdocumentor-description"></section>
  479. </dd>
  480. </dl>
  481. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  482. <span class="phpdocumentor-signature__response_type">self</span>
  483. &mdash;
  484. </article>
  485. <article
  486. class="phpdocumentor-element
  487. -method
  488. -public
  489. "
  490. >
  491. <h4 class="phpdocumentor-element__name" id="method_putBit">
  492. putBit()
  493. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_putBit" class="headerlink"><i class="fas fa-link"></i></a>
  494. </h4>
  495. <aside class="phpdocumentor-element-found-in">
  496. <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>
  497. :
  498. <span class="phpdocumentor-element-found-in__line">68</span>
  499. </aside>
  500. <p class="phpdocumentor-summary">appends a single bit</p>
  501. <code class="phpdocumentor-code phpdocumentor-signature ">
  502. <span class="phpdocumentor-signature__visibility">public</span>
  503. <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>
  504. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  505. <dl class="phpdocumentor-argument-list">
  506. <dt class="phpdocumentor-argument-list__entry">
  507. <span class="phpdocumentor-signature__argument__name">$bit</span>
  508. : <span class="phpdocumentor-signature__argument__return-type">bool</span>
  509. </dt>
  510. <dd class="phpdocumentor-argument-list__definition">
  511. <section class="phpdocumentor-description"></section>
  512. </dd>
  513. </dl>
  514. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  515. <span class="phpdocumentor-signature__response_type">self</span>
  516. &mdash;
  517. </article>
  518. <article
  519. class="phpdocumentor-element
  520. -method
  521. -public
  522. "
  523. >
  524. <h4 class="phpdocumentor-element__name" id="method_read">
  525. read()
  526. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_read" 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">115</span>
  532. </aside>
  533. <code class="phpdocumentor-code phpdocumentor-signature ">
  534. <span class="phpdocumentor-signature__visibility">public</span>
  535. <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>
  536. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  537. <dl class="phpdocumentor-argument-list">
  538. <dt class="phpdocumentor-argument-list__entry">
  539. <span class="phpdocumentor-signature__argument__name">$numBits</span>
  540. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  541. </dt>
  542. <dd class="phpdocumentor-argument-list__definition">
  543. <section class="phpdocumentor-description"><p>number of bits to read</p>
  544. </section>
  545. </dd>
  546. </dl>
  547. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  548. Tags
  549. <a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
  550. </h5>
  551. <dl class="phpdocumentor-tag-list">
  552. <dt class="phpdocumentor-tag-list__entry">
  553. <span class="phpdocumentor-tag__name">author</span>
  554. </dt>
  555. <dd class="phpdocumentor-tag-list__definition">
  556. <section class="phpdocumentor-description"><p>Sean Owen, ZXing</p>
  557. </section>
  558. </dd>
  559. <dt class="phpdocumentor-tag-list__entry">
  560. <span class="phpdocumentor-tag__name">throws</span>
  561. </dt>
  562. <dd class="phpdocumentor-tag-list__definition">
  563. <span class="phpdocumentor-tag-link"><a href="classes/chillerlan-QRCode-QRCodeException.html"><abbr title="\chillerlan\QRCode\QRCodeException">QRCodeException</abbr></a></span>
  564. <section class="phpdocumentor-description"><p>if numBits isn't in [1,32] or more than is available</p>
  565. </section>
  566. </dd>
  567. </dl>
  568. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  569. <span class="phpdocumentor-signature__response_type">int</span>
  570. &mdash;
  571. <section class="phpdocumentor-description"><p>representing the bits read. The bits will appear as the least-significant bits of the int</p>
  572. </section>
  573. </article>
  574. <article
  575. class="phpdocumentor-element
  576. -method
  577. -public
  578. "
  579. >
  580. <h4 class="phpdocumentor-element__name" id="method_rewind">
  581. rewind()
  582. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_rewind" class="headerlink"><i class="fas fa-link"></i></a>
  583. </h4>
  584. <aside class="phpdocumentor-element-found-in">
  585. <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>
  586. :
  587. <span class="phpdocumentor-element-found-in__line">173</span>
  588. </aside>
  589. <p class="phpdocumentor-summary">Resets the read-counters</p>
  590. <code class="phpdocumentor-code phpdocumentor-signature ">
  591. <span class="phpdocumentor-signature__visibility">public</span>
  592. <span class="phpdocumentor-signature__name">rewind</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
  593. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  594. <span class="phpdocumentor-signature__response_type">self</span>
  595. &mdash;
  596. </article>
  597. </section>
  598. <script type="text/javascript">
  599. function loadExternalCodeSnippets(line) {
  600. Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach((pre) => {
  601. var src = pre.getAttribute('data-src').replace( /\\/g, '/');
  602. var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
  603. var language = 'php';
  604. var code = document.createElement('code');
  605. code.className = 'language-' + language;
  606. pre.textContent = '';
  607. pre.setAttribute('data-line', line)
  608. code.textContent = 'Loading…';
  609. pre.appendChild(code);
  610. var xhr = new XMLHttpRequest();
  611. xhr.open('GET', src, true);
  612. xhr.onreadystatechange = function () {
  613. if (xhr.readyState == 4) {
  614. if (xhr.status < 400 && xhr.responseText) {
  615. code.textContent = xhr.responseText;
  616. Prism.highlightElement(code);
  617. }
  618. else if (xhr.status >= 400) {
  619. code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
  620. }
  621. else {
  622. code.textContent = '✖ Error: File does not exist, is empty or trying to view from localhost';
  623. }
  624. }
  625. };
  626. xhr.send(null);
  627. });
  628. }
  629. var modals = document.querySelectorAll("[data-modal]");
  630. modals.forEach(function (trigger) {
  631. trigger.addEventListener("click", function (event) {
  632. //event.preventDefault();
  633. const modal = document.getElementById(trigger.dataset.modal);
  634. modal.classList.add("phpdocumentor-modal__open");
  635. loadExternalCodeSnippets(trigger.dataset.line)
  636. const exits = modal.querySelectorAll("[data-exit-button]");
  637. exits.forEach(function (exit) {
  638. exit.addEventListener("click", function (event) {
  639. event.preventDefault();
  640. modal.classList.remove("phpdocumentor-modal__open");
  641. });
  642. });
  643. });
  644. });
  645. </script>
  646. </article>
  647. <section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
  648. <section class="phpdocumentor-search-results__dialog">
  649. <header class="phpdocumentor-search-results__header">
  650. <h2 class="phpdocumentor-search-results__title">Search results</h2>
  651. <button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
  652. </header>
  653. <section class="phpdocumentor-search-results__body">
  654. <ul class="phpdocumentor-search-results__entries"></ul>
  655. </section>
  656. </section>
  657. </section>
  658. </div>
  659. </div>
  660. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
  661. </main>
  662. <script>
  663. cssVars({});
  664. </script>
  665. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
  666. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
  667. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
  668. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
  669. </body>
  670. </html>