chillerlan-QRCode-Common-BitBuffer.html 44 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052
  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. d=document.getElementsByClassName("line-numbers");
  667. d[0].scrollTop = d[0].children[1].offsetTop;
  668. return;
  669. }
  670. if (xhr.status === 404) {
  671. code.textContent = '✖ Error: File could not be found';
  672. return;
  673. }
  674. if (xhr.status >= 400) {
  675. code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
  676. return;
  677. }
  678. code.textContent = '✖ Error: An unknown error occurred';
  679. };
  680. xhr.send(null);
  681. });
  682. }
  683. const modalButtons = document.querySelectorAll("[data-modal]");
  684. const openedAsLocalFile = window.location.protocol === 'file:';
  685. if (modalButtons.length > 0 && openedAsLocalFile) {
  686. console.warn(
  687. 'Viewing the source code is unavailable because you are opening this page from the file:// scheme; ' +
  688. 'browsers block XHR requests when a page is opened this way'
  689. );
  690. }
  691. modalButtons.forEach(function (trigger) {
  692. if (openedAsLocalFile) {
  693. trigger.setAttribute("hidden", "hidden");
  694. }
  695. trigger.addEventListener("click", function (event) {
  696. event.preventDefault();
  697. const modal = document.getElementById(trigger.dataset.modal);
  698. if (!modal) {
  699. console.error(`Modal with id "${trigger.dataset.modal}" could not be found`);
  700. return;
  701. }
  702. modal.classList.add("phpdocumentor-modal__open");
  703. loadExternalCodeSnippet(modal, trigger.dataset.src || null, trigger.dataset.line)
  704. const exits = modal.querySelectorAll("[data-exit-button]");
  705. exits.forEach(function (exit) {
  706. exit.addEventListener("click", function (event) {
  707. event.preventDefault();
  708. modal.classList.remove("phpdocumentor-modal__open");
  709. });
  710. });
  711. });
  712. });
  713. })();
  714. </script>
  715. </article>
  716. </section>
  717. <section class="phpdocumentor-on-this-page__sidebar">
  718. <section class="phpdocumentor-on-this-page__content">
  719. <strong class="phpdocumentor-on-this-page__title">On this page</strong>
  720. <ul class="phpdocumentor-list -clean">
  721. <li class="phpdocumentor-on-this-page-section__title">Table Of Contents</li>
  722. <li>
  723. <ul class="phpdocumentor-list -clean">
  724. <li><a href="classes/chillerlan-QRCode-Common-BitBuffer.html#toc-properties">Properties</a></li>
  725. <li><a href="classes/chillerlan-QRCode-Common-BitBuffer.html#toc-methods">Methods</a></li>
  726. </ul>
  727. </li>
  728. <li class="phpdocumentor-on-this-page-section__title">Properties</li>
  729. <li>
  730. <ul class="phpdocumentor-list -clean">
  731. <li class=""><a href="classes/chillerlan-QRCode-Common-BitBuffer.html#property_bitsRead">$bitsRead</a></li>
  732. <li class=""><a href="classes/chillerlan-QRCode-Common-BitBuffer.html#property_buffer">$buffer</a></li>
  733. <li class=""><a href="classes/chillerlan-QRCode-Common-BitBuffer.html#property_bytesRead">$bytesRead</a></li>
  734. <li class=""><a href="classes/chillerlan-QRCode-Common-BitBuffer.html#property_length">$length</a></li>
  735. </ul>
  736. </li>
  737. <li class="phpdocumentor-on-this-page-section__title">Methods</li>
  738. <li>
  739. <ul class="phpdocumentor-list -clean">
  740. <li class=""><a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method___construct">__construct()</a></li>
  741. <li class=""><a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_available">available()</a></li>
  742. <li class=""><a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_clear">clear()</a></li>
  743. <li class=""><a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_getBuffer">getBuffer()</a></li>
  744. <li class=""><a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_getLength">getLength()</a></li>
  745. <li class=""><a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_put">put()</a></li>
  746. <li class=""><a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_putBit">putBit()</a></li>
  747. <li class=""><a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_read">read()</a></li>
  748. <li class=""><a href="classes/chillerlan-QRCode-Common-BitBuffer.html#method_rewind">rewind()</a></li>
  749. </ul>
  750. </li>
  751. </ul>
  752. </section>
  753. </section>
  754. </div>
  755. <section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
  756. <section class="phpdocumentor-search-results__dialog">
  757. <header class="phpdocumentor-search-results__header">
  758. <h2 class="phpdocumentor-search-results__title">Search results</h2>
  759. <button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
  760. </header>
  761. <section class="phpdocumentor-search-results__body">
  762. <ul class="phpdocumentor-search-results__entries"></ul>
  763. </section>
  764. </section>
  765. </section>
  766. </div>
  767. <a href="classes/chillerlan-QRCode-Common-BitBuffer.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
  768. </main>
  769. <script>
  770. cssVars({});
  771. </script>
  772. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
  773. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
  774. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
  775. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
  776. </body>
  777. </html>