كتابة count بايت من المخزن المؤقت المحدد إلى ساحة المشاركات
التفاصيل
المعلمات
stream
ساحة المشاركات المطلوب الكتابة إليها
buf
المخزن المؤقت المطلوب القراءة منه.
count
عدد وحدات البايت المراد كتابتها.
المرتجعات
true إذا كان ناجحًا أو false في خطأ كتابة.
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","easyToUnderstand","thumb-up"],["ساعَدني المحتوى في حلّ مشكلتي.","solvedMyProblem","thumb-up"],["غير ذلك","otherUp","thumb-up"]],[["لا يحتوي على المعلومات التي أحتاج إليها.","missingTheInformationINeed","thumb-down"],["الخطوات معقدة للغاية / كثيرة جدًا.","tooComplicatedTooManySteps","thumb-down"],["المحتوى قديم.","outOfDate","thumb-down"],["ثمة مشكلة في الترجمة.","translationIssue","thumb-down"],["مشكلة في العيّنات / التعليمات البرمجية","samplesCodeIssue","thumb-down"],["غير ذلك","otherDown","thumb-down"]],["تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# tuningfork::VectorStream Struct Reference\n\ntuningfork::VectorStream\n========================\n\n`#include \u003cprotobuf_nano_util.h\u003e`\n\nA view on the vector provided in `vec`.\n\nSummary\n-------\n\nNo ownership is taken.\n\n| Details ||\n|------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Parameters | |-------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `vec` | Example usage: ```css+lasso std::vector\u003cuint8_t\u003e v; VectorStream str {&v, 0}; pb_ostream_t stream = {VectorStream::Write, &str, SIZE_MAX, 0}; pb_encode(&stream, ...); ``` | |\n\n| ### Public attributes ||\n|-------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------|\n| [it](#structtuningfork_1_1_vector_stream_1a15e8cd3ec11280c7e7060563a197d195) | `size_t` The current position in the vector while decoding or encoding. |\n| [vec](#structtuningfork_1_1_vector_stream_1a3fc88833828997802f63f25ecfc9596e) | `std::vector\u003c uint8_t \u003e *` A vector of bytes that must be valid while `Read` or `Write` are called. |\n\n| ### Public static functions ||\n|-------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------|\n| [Read](#structtuningfork_1_1_vector_stream_1add5291b48820efba50df20aed1acf095)`(pb_istream_t *stream, uint8_t *buf, size_t count)` | `bool` Read `count` bytes from the stream to the given buffer. |\n| [Write](#structtuningfork_1_1_vector_stream_1a9a25c5eebeb2335dfcb069e247784cf8)`(pb_ostream_t *stream, const uint8_t *buf, size_t count)` | `bool` Write `count` bytes from the given buffer to the stream. |\n\nPublic attributes\n-----------------\n\n### it\n\n```scdoc\nsize_t tuningfork::VectorStream::it\n``` \nThe current position in the vector while decoding or encoding. \n\n### vec\n\n```scdoc\nstd::vector\u003c uint8_t \u003e * tuningfork::VectorStream::vec\n``` \nA vector of bytes that must be valid while `Read` or `Write` are called.\n\nThe vector will be resized as needed by `Write`.\n\nPublic static functions\n-----------------------\n\n### Read\n\n```scdoc\nbool tuningfork::VectorStream::Read(\n pb_istream_t *stream,\n uint8_t *buf,\n size_t count\n)\n``` \nRead `count` bytes from the stream to the given buffer.\n\n\u003cbr /\u003e\n\n| Details ||\n|-------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Parameters | |----------|------------------------------| | `stream` | The stream to read from. | | `buf` | The buffer to write to. | | `count` | The number of bytes to read. | |\n| **Returns** | true if successful, false on a read error. |\n\n### Write\n\n```gdscript\nbool tuningfork::VectorStream::Write(\n pb_ostream_t *stream,\n const uint8_t *buf,\n size_t count\n)\n``` \nWrite `count` bytes from the given buffer to the stream.\n\n\u003cbr /\u003e\n\n| Details ||\n|-------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Parameters | |----------|-------------------------------| | `stream` | The stream to write to. | | `buf` | The buffer to read from. | | `count` | The number of bytes to write. | |\n| **Returns** | true if successful, false on a write error. |"]]