diff options
| author | Ansariel <ansariel.hiller@phoenixviewer.com> | 2024-05-22 19:04:52 +0200 |
|---|---|---|
| committer | Ansariel <ansariel.hiller@phoenixviewer.com> | 2024-05-22 19:04:52 +0200 |
| commit | 1b67dd855c41f5a0cda7ec2a68d98071986ca703 (patch) | |
| tree | ab243607f74f78200787bba5b9b88f07ef1b966f /indra/llcorehttp/bufferarray.h | |
| parent | 6d6eabca44d08d5b97bfe3e941d2b9687c2246ea (diff) | |
| parent | e1623bb276f83a43ce7a197e388720c05bdefe61 (diff) | |
Merge remote-tracking branch 'origin/main' into DRTVWR-600-maint-A
# Conflicts:
# autobuild.xml
# indra/cmake/CMakeLists.txt
# indra/cmake/GoogleMock.cmake
# indra/llaudio/llaudioengine_fmodstudio.cpp
# indra/llaudio/llaudioengine_fmodstudio.h
# indra/llaudio/lllistener_fmodstudio.cpp
# indra/llaudio/lllistener_fmodstudio.h
# indra/llaudio/llstreamingaudio_fmodstudio.cpp
# indra/llaudio/llstreamingaudio_fmodstudio.h
# indra/llcharacter/llmultigesture.cpp
# indra/llcharacter/llmultigesture.h
# indra/llimage/llimage.cpp
# indra/llimage/llimagepng.cpp
# indra/llimage/llimageworker.cpp
# indra/llimage/tests/llimageworker_test.cpp
# indra/llmessage/tests/llmockhttpclient.h
# indra/llprimitive/llgltfmaterial.h
# indra/llrender/llfontfreetype.cpp
# indra/llui/llcombobox.cpp
# indra/llui/llfolderview.cpp
# indra/llui/llfolderviewmodel.h
# indra/llui/lllineeditor.cpp
# indra/llui/lllineeditor.h
# indra/llui/lltextbase.cpp
# indra/llui/lltextbase.h
# indra/llui/lltexteditor.cpp
# indra/llui/lltextvalidate.cpp
# indra/llui/lltextvalidate.h
# indra/llui/lluictrl.h
# indra/llui/llview.cpp
# indra/llwindow/llwindowmacosx.cpp
# indra/newview/app_settings/settings.xml
# indra/newview/llappearancemgr.cpp
# indra/newview/llappearancemgr.h
# indra/newview/llavatarpropertiesprocessor.cpp
# indra/newview/llavatarpropertiesprocessor.h
# indra/newview/llbreadcrumbview.cpp
# indra/newview/llbreadcrumbview.h
# indra/newview/llbreastmotion.cpp
# indra/newview/llbreastmotion.h
# indra/newview/llconversationmodel.h
# indra/newview/lldensityctrl.cpp
# indra/newview/lldensityctrl.h
# indra/newview/llface.inl
# indra/newview/llfloatereditsky.cpp
# indra/newview/llfloatereditwater.cpp
# indra/newview/llfloateremojipicker.h
# indra/newview/llfloaterimsessiontab.cpp
# indra/newview/llfloaterprofiletexture.cpp
# indra/newview/llfloaterprofiletexture.h
# indra/newview/llgesturemgr.cpp
# indra/newview/llgesturemgr.h
# indra/newview/llimpanel.cpp
# indra/newview/llimpanel.h
# indra/newview/llinventorybridge.cpp
# indra/newview/llinventorybridge.h
# indra/newview/llinventoryclipboard.cpp
# indra/newview/llinventoryclipboard.h
# indra/newview/llinventoryfunctions.cpp
# indra/newview/llinventoryfunctions.h
# indra/newview/llinventorygallery.cpp
# indra/newview/lllistbrowser.cpp
# indra/newview/lllistbrowser.h
# indra/newview/llpanelobjectinventory.cpp
# indra/newview/llpanelprofile.cpp
# indra/newview/llpanelprofile.h
# indra/newview/llpreviewgesture.cpp
# indra/newview/llsavedsettingsglue.cpp
# indra/newview/llsavedsettingsglue.h
# indra/newview/lltooldraganddrop.cpp
# indra/newview/llurllineeditorctrl.cpp
# indra/newview/llvectorperfoptions.cpp
# indra/newview/llvectorperfoptions.h
# indra/newview/llviewerparceloverlay.cpp
# indra/newview/llviewertexlayer.cpp
# indra/newview/llviewertexturelist.cpp
# indra/newview/macmain.h
# indra/test/test.cpp
Diffstat (limited to 'indra/llcorehttp/bufferarray.h')
| -rw-r--r-- | indra/llcorehttp/bufferarray.h | 114 |
1 files changed, 57 insertions, 57 deletions
diff --git a/indra/llcorehttp/bufferarray.h b/indra/llcorehttp/bufferarray.h index 320adf2b8b..0269d1785e 100644 --- a/indra/llcorehttp/bufferarray.h +++ b/indra/llcorehttp/bufferarray.h @@ -24,8 +24,8 @@ * $/LicenseInfo$ */ -#ifndef _LLCORE_BUFFER_ARRAY_H_ -#define _LLCORE_BUFFER_ARRAY_H_ +#ifndef _LLCORE_BUFFER_ARRAY_H_ +#define _LLCORE_BUFFER_ARRAY_H_ #include <cstdlib> @@ -67,75 +67,75 @@ class BufferArrayStreamBuf; class BufferArray : public LLCoreInt::RefCounted { public: - // BufferArrayStreamBuf has intimate knowledge of this - // implementation to implement a buffer-free adapter. - // Changes here will likely need to be reflected there. - friend class BufferArrayStreamBuf; - - BufferArray(); + // BufferArrayStreamBuf has intimate knowledge of this + // implementation to implement a buffer-free adapter. + // Changes here will likely need to be reflected there. + friend class BufferArrayStreamBuf; - typedef LLCoreInt::IntrusivePtr<BufferArray> ptr_t; + BufferArray(); + + typedef LLCoreInt::IntrusivePtr<BufferArray> ptr_t; protected: - virtual ~BufferArray(); // Use release() + virtual ~BufferArray(); // Use release() private: - BufferArray(const BufferArray &); // Not defined - void operator=(const BufferArray &); // Not defined + BufferArray(const BufferArray &); // Not defined + void operator=(const BufferArray &); // Not defined public: - // Internal magic number, may be used by unit tests. - static const size_t BLOCK_ALLOC_SIZE = 65540; - - /// Appends the indicated data to the BufferArray - /// modifying current position and total size. New - /// position is one beyond the final byte of the buffer. - /// - /// @return Count of bytes copied to BufferArray - size_t append(const void * src, size_t len); - - /// Similar to @see append(), this call guarantees a - /// contiguous block of memory of requested size placed - /// at the current end of the BufferArray. On return, - /// the data in the memory is considered valid whether - /// the caller writes to it or not. - /// - /// @return Pointer to contiguous region at end - /// of BufferArray of 'len' size. - void * appendBufferAlloc(size_t len); - - /// Current count of bytes in BufferArray instance. - size_t size() const - { - return mLen; - } - - /// Copies data from the given position in the instance - /// to the caller's buffer. Will return a short count of - /// bytes copied if the 'len' extends beyond the data. - size_t read(size_t pos, void * dst, size_t len); - - /// Copies data from the caller's buffer to the instance - /// at the current position. May overwrite existing data, - /// append data when current position is equal to the - /// size of the instance or do a mix of both. - size_t write(size_t pos, const void * src, size_t len); - + // Internal magic number, may be used by unit tests. + static const size_t BLOCK_ALLOC_SIZE = 65540; + + /// Appends the indicated data to the BufferArray + /// modifying current position and total size. New + /// position is one beyond the final byte of the buffer. + /// + /// @return Count of bytes copied to BufferArray + size_t append(const void * src, size_t len); + + /// Similar to @see append(), this call guarantees a + /// contiguous block of memory of requested size placed + /// at the current end of the BufferArray. On return, + /// the data in the memory is considered valid whether + /// the caller writes to it or not. + /// + /// @return Pointer to contiguous region at end + /// of BufferArray of 'len' size. + void * appendBufferAlloc(size_t len); + + /// Current count of bytes in BufferArray instance. + size_t size() const + { + return mLen; + } + + /// Copies data from the given position in the instance + /// to the caller's buffer. Will return a short count of + /// bytes copied if the 'len' extends beyond the data. + size_t read(size_t pos, void * dst, size_t len); + + /// Copies data from the caller's buffer to the instance + /// at the current position. May overwrite existing data, + /// append data when current position is equal to the + /// size of the instance or do a mix of both. + size_t write(size_t pos, const void * src, size_t len); + protected: - int findBlock(size_t pos, size_t * ret_offset); + int findBlock(size_t pos, size_t * ret_offset); + + bool getBlockStartEnd(int block, const char ** start, const char ** end); - bool getBlockStartEnd(int block, const char ** start, const char ** end); - protected: - class Block; - typedef std::vector<Block *> container_t; + class Block; + typedef std::vector<Block *> container_t; - container_t mBlocks; - size_t mLen; + container_t mBlocks; + size_t mLen; }; // end class BufferArray } // end namespace LLCore -#endif // _LLCORE_BUFFER_ARRAY_H_ +#endif // _LLCORE_BUFFER_ARRAY_H_ |
