Skip to content

Commit 74822f5

Browse files
sndpp: take a path object in ctor methods
1 parent fef784f commit 74822f5

File tree

6 files changed

+8
-9
lines changed

6 files changed

+8
-9
lines changed

include/sndpp/RIFF.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22

3+
#include <filesystem>
34
#include <span>
4-
#include <string>
55
#include <utility>
66
#include <vector>
77

@@ -21,7 +21,7 @@ class RIFF {
2121

2222
explicit RIFF(std::span<const std::byte> riffData, uint32_t type_);
2323

24-
explicit RIFF(const std::string& riffPath, uint32_t type_);
24+
explicit RIFF(const std::filesystem::path& riffPath, uint32_t type_);
2525

2626
[[nodiscard]] explicit operator bool() const;
2727

include/sndpp/WAV.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ class WAV : public RIFF {
173173

174174
explicit WAV(std::span<const std::byte> wavData);
175175

176-
explicit WAV(const std::string& wavPath);
176+
explicit WAV(const std::filesystem::path& wavPath);
177177

178178
template<ChunkType Type>
179179
[[nodiscard]] auto getFirstWAVChunk() const {

include/sndpp/XWV.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22

3+
#include <filesystem>
34
#include <span>
4-
#include <string>
55
#include <vector>
66

77
#include <sourcepp/parser/Binary.h>
@@ -31,7 +31,7 @@ class XWV {
3131

3232
explicit XWV(std::span<const std::byte> xwvData);
3333

34-
explicit XWV(const std::string& xwvPath);
34+
explicit XWV(const std::filesystem::path& xwvPath);
3535

3636
explicit operator bool() const;
3737

src/sndpp/RIFF.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#include <algorithm>
44

55
#include <BufferStream.h>
6-
#include <filesystem>
76
#include <sourcepp/FS.h>
87

98
using namespace sndpp;
@@ -48,7 +47,7 @@ RIFF::RIFF(std::vector<std::byte>&& riffData, uint32_t type_)
4847
RIFF::RIFF(std::span<const std::byte> riffData, uint32_t type_)
4948
: RIFF{std::vector<std::byte>{riffData.begin(), riffData.end()}, type_} {}
5049

51-
RIFF::RIFF(const std::string& riffPath, uint32_t type_)
50+
RIFF::RIFF(const std::filesystem::path& riffPath, uint32_t type_)
5251
: RIFF{fs::readFileBuffer(riffPath), type_} {}
5352

5453
RIFF::operator bool() const {

src/sndpp/WAV.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ WAV::WAV(std::vector<std::byte>&& wavData)
1616
WAV::WAV(std::span<const std::byte> wavData)
1717
: RIFF{wavData, WAV_TYPE} {}
1818

19-
WAV::WAV(const std::string& wavPath)
19+
WAV::WAV(const std::filesystem::path& wavPath)
2020
: RIFF{wavPath, WAV_TYPE} {}

src/sndpp/XWV.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ XWV::XWV(std::span<const std::byte> xwvData)
134134
this->opened = true;
135135
}
136136

137-
XWV::XWV(const std::string& xwvPath)
137+
XWV::XWV(const std::filesystem::path& xwvPath)
138138
: XWV(fs::readFileBuffer(xwvPath)) {}
139139

140140
XWV::operator bool() const {

0 commit comments

Comments
 (0)