Skip to content

Commit f2d3d55

Browse files
committed
readme update
1 parent d4522f1 commit f2d3d55

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

MPSToken.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,15 @@ void MPSToken::split()
8787
int count = 0;
8888
for ( ; iter != tokenizer.end(); ++iter) {
8989
// create sub-tokens
90+
91+
boost::shared_ptr<MPSToken> subToken (new MPSToken(this, *iter, L"", m_discard));
92+
m_subtokens_shared.push_back(subToken);
93+
9094
MPSToken* sub_token = new MPSToken (this, *iter, L"", m_discard);
9195
m_subtokens.push_back(sub_token);
96+
97+
98+
9299
++count;
93100
}
94101
}

MPSToken.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define MPSHEADER_HPP
33

44
#include <boost/tokenizer.hpp>
5+
#include <boost/shared_ptr.hpp>
56
#include <string>
67
#include <list>
78

@@ -11,6 +12,8 @@ typedef boost::tokenizer<BoostSeparator, std::wstring::const_iterator, std::wstr
1112
class MPSToken;
1213
typedef std::list<MPSToken*> MPSTokensContainer;
1314

15+
typedef std::list<boost::shared_ptr<MPSToken> > MPSTokensSharedContainer;
16+
1417
enum EMPSDirection {
1518
ELeft,
1619
ERight
@@ -88,6 +91,7 @@ class MPSToken {
8891
std::wstring m_separators; // current separators
8992
bool m_discard; // flag to indicate if we're discarding this one or not
9093
MPSTokensContainer m_subtokens; // result after split into tokens using current separators
94+
MPSTokensSharedContainer m_subtokens_shared; // shared pointers to subtokens, if needed
9195
};
9296

9397
#endif // MPSHEADER_HPP

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
Visually rename your mp3 files.
44

5-
WARNING: *Use at your own risk*. I haven't taken the time to test all memory allocation issues, and there are some.
5+
**WARNING:** *Use at your own risk*.
66

7-
I'm planning to use smart pointers in the near future.
7+
I haven't taken the time to test all memory allocation issues, and there are quite some. That's because I'm using raw pointers. There, I've said it. Yes, I know there are smart pointers and I am planning on refactoring the app and use them.
8+
9+
But until then, use at your own risk.
810

911
<img src="assets/MemphisNow.png" alt="Memphis Now (C++)" style="max-width: 640px;">
1012

@@ -15,7 +17,6 @@ I'm planning to use smart pointers in the near future.
1517

1618
### Build Instructions ###
1719

18-
<ul>
19-
<li>[Download Qt (for Windows)](https://www.qt.io/download-qt-installer-oss)</li>
20-
<li>[Install boost_1.88 on Windows (for msvc)](https://www.realityframeworks.com/install-boost-on-windows-for-msvc-gcc/)</li>
21-
</ul>
20+
[Download Qt (for Windows)](https://www.qt.io/download-qt-installer-oss)
21+
[Install boost_1.88 on Windows (for msvc)](https://www.realityframeworks.com/install-boost-on-windows-for-msvc-gcc/)
22+

0 commit comments

Comments
 (0)