summaryrefslogtreecommitdiff
path: root/xfa/fxbarcode/common/BC_CommonByteArray.h
diff options
context:
space:
mode:
authorweili <weili@chromium.org>2016-08-09 13:45:03 -0700
committerCommit bot <commit-bot@chromium.org>2016-08-09 13:45:03 -0700
commite76203dbefd1df075a063ee019c3908513f6bee5 (patch)
tree2a763852e1d1de3eee6a67285ea96be2874bfb00 /xfa/fxbarcode/common/BC_CommonByteArray.h
parentad5ac7584844b03c5ceed082e5f5158a632405cc (diff)
downloadpdfium-e76203dbefd1df075a063ee019c3908513f6bee5.tar.xz
Use smart pointers for class owned pointers in xfa/fxbarcode
For classes under xfa/fxbarcode, use smart pointers instead of raw pointer to make memory management easier. Also fix some styling issues along the changes. BUG=pdfium:518 Review-Url: https://codereview.chromium.org/2221023003
Diffstat (limited to 'xfa/fxbarcode/common/BC_CommonByteArray.h')
-rw-r--r--xfa/fxbarcode/common/BC_CommonByteArray.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/xfa/fxbarcode/common/BC_CommonByteArray.h b/xfa/fxbarcode/common/BC_CommonByteArray.h
index 2570f81c0f..cdda41b4fd 100644
--- a/xfa/fxbarcode/common/BC_CommonByteArray.h
+++ b/xfa/fxbarcode/common/BC_CommonByteArray.h
@@ -9,6 +9,8 @@
#include "core/fxcrt/include/fx_basic.h"
+// TODO(weili): The usage of this class should be replaced by
+// std::vector<uint8_t>.
class CBC_CommonByteArray {
public:
CBC_CommonByteArray();
@@ -16,10 +18,10 @@ class CBC_CommonByteArray {
CBC_CommonByteArray(uint8_t* byteArray, int32_t size);
virtual ~CBC_CommonByteArray();
- int32_t At(int32_t index);
+ int32_t At(int32_t index) const;
+ int32_t Size() const;
+ FX_BOOL IsEmpty() const;
void Set(int32_t index, int32_t value);
- int32_t Size();
- FX_BOOL IsEmpty();
void AppendByte(int32_t value);
void Reserve(int32_t capacity);
void Set(uint8_t* source, int32_t offset, int32_t count);