Skip to content

Commit db84d87

Browse files
committed
docs; warnings
1 parent 376c984 commit db84d87

3 files changed

Lines changed: 27 additions & 17 deletions

File tree

src/odr/internal/cfb/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ CFB stands for _Microsoft Compound File Binary File Format_
77
## Features
88

99
- [x] from memory
10-
- [ ] from file
10+
- [x] from file
1111
- [x] list entries
1212
- [x] read as stream
1313
- [x] write as stream
1414

1515
## References
1616

17-
implementation relies on [microsoft/compoundfilereader](https://github.com/microsoft/compoundfilereader)
17+
- [[MS-CFB]: Compound File Binary File Format](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cfb)
18+
- implementation relies on [microsoft/compoundfilereader](https://github.com/microsoft/compoundfilereader)
1819

1920
### Related work
2021

src/odr/internal/oldms/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
## references
44

55
- [Technical Documents](https://docs.microsoft.com/en-us/openspecs/office_file_formats/MS-OFFFFLP/6ae2fd93-51fc-4e75-a54a-1b175c627b51)
6-
- [[MS-DOC]: Word (.doc) Binary File Format](https://docs.microsoft.com/en-us/openspecs/office_file_formats/ms-doc/ccd7b486-7881-484c-a137-51170af7cc22)
7-
- [[MS-PPT]: PowerPoint (.ppt) Binary File Format](https://docs.microsoft.com/en-us/openspecs/office_file_formats/ms-ppt/6be79dde-33c1-4c1b-8ccc-4b2301c08662)
8-
- [[MS-XLS]: Excel Binary File Format (.xls) Structure](https://docs.microsoft.com/en-us/openspecs/office_file_formats/ms-xls/cd03cb5f-ca02-4934-a391-bb674cb8aa06)
9-
- [[MS-XLSB]: Excel (.xlsb) Binary File Format](https://docs.microsoft.com/en-us/openspecs/office_file_formats/ms-xlsb/acc8aa92-1f02-4167-99f5-84f9f676b95a)
6+
- [[MS-DOC]: Word (.doc) Binary File Format](https://docs.microsoft.com/en-us/openspecs/office_file_formats/ms-doc)
7+
- [[MS-PPT]: PowerPoint (.ppt) Binary File Format](https://docs.microsoft.com/en-us/openspecs/office_file_formats/ms-ppt)
8+
- [[MS-XLS]: Excel Binary File Format (.xls) Structure](https://docs.microsoft.com/en-us/openspecs/office_file_formats/ms-xls)
9+
- [[MS-XLSB]: Excel (.xlsb) Binary File Format](https://docs.microsoft.com/en-us/openspecs/office_file_formats/ms-xlsb)
10+
- [[MS-CFB]: Compound File Binary File Format](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cfb)
11+
- [[MS-OFFCRYPTO]: Office Document Cryptography Structure](https://learn.microsoft.com/en-us/openspecs/office_file_formats/ms-offcrypto)
1012

1113
### related work
1214

src/odr/internal/oldms/word/structs.hpp

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#include <memory>
66
#include <stdexcept>
77
#include <string>
8-
#include <vector>
98

109
namespace odr::internal::oldms {
1110

@@ -273,7 +272,7 @@ struct Sprm {
273272
std::uint16_t sgc : 3;
274273
std::uint16_t spra : 3;
275274

276-
int operand_size() const {
275+
[[nodiscard]] int operand_size() const {
277276
switch (spra) {
278277
case 0:
279278
case 1:
@@ -351,23 +350,31 @@ template <typename Derived, typename Data> class PlcBase {
351350
public:
352351
static constexpr std::uint32_t cbData() { return sizeof(Data); }
353352

354-
std::uint32_t n() const { return (self().cbPlc() - 4) / (4 + sizeof(Data)); }
353+
[[nodiscard]] std::uint32_t n() const {
354+
return (self().cbPlc() - 4) / (4 + sizeof(Data));
355+
}
355356

356-
const std::uint32_t *aCP_ptr() const {
357+
[[nodiscard]] const std::uint32_t *aCP_ptr() const {
357358
return reinterpret_cast<const std::uint32_t *>(self().data());
358359
}
359360

360-
const Data *aData_ptr() const {
361+
[[nodiscard]] const Data *aData_ptr() const {
361362
return reinterpret_cast<const Data *>(self().data() + (n() + 1) * 4);
362363
}
363364

364-
std::uint32_t aCP(const std::uint32_t i) const { return aCP_ptr()[i]; }
365+
[[nodiscard]] std::uint32_t aCP(const std::uint32_t i) const {
366+
return aCP_ptr()[i];
367+
}
365368

366-
Data aData(const std::uint32_t i) const { return aData_ptr()[i]; }
369+
[[nodiscard]] Data aData(const std::uint32_t i) const {
370+
return aData_ptr()[i];
371+
}
367372

368373
private:
369-
Derived &self() { return *static_cast<Derived *>(this); }
370-
const Derived &self() const { return *static_cast<const Derived *>(this); }
374+
[[nodiscard]] Derived &self() { return *static_cast<Derived *>(this); }
375+
[[nodiscard]] const Derived &self() const {
376+
return *static_cast<const Derived *>(this);
377+
}
371378
};
372379

373380
template <typename Derived> class PlcPcdBase : public PlcBase<Derived, Pcd> {};
@@ -377,8 +384,8 @@ class PlcPcdMap : public PlcPcdBase<PlcPcdMap> {
377384
PlcPcdMap(char *data, const std::size_t cbPlc)
378385
: m_data(data), m_cbPlc(cbPlc) {}
379386

380-
char *data() const { return m_data; }
381-
std::size_t cbPlc() const { return m_cbPlc; }
387+
[[nodiscard]] char *data() const { return m_data; }
388+
[[nodiscard]] std::size_t cbPlc() const { return m_cbPlc; }
382389

383390
private:
384391
char *m_data{nullptr};

0 commit comments

Comments
 (0)