2013-05-05 09:21:30 +00:00
|
|
|
#ifdef NALL_STRING_INTERNAL_HPP
|
|
|
|
|
|
|
|
namespace nall {
|
|
|
|
|
|
|
|
optional<unsigned> lstring::find(rstring key) const {
|
|
|
|
for(unsigned i = 0; i < size(); i++) {
|
|
|
|
if(operator[](i) == key) return {true, i};
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
Update to v093r01 release.
byuu says:
Changelog:
- added SA-1 MDR; fixes bug in SD Gundam G-Next where the main
battleship was unable to fire
- added out-of-the-box support for any BSD running Clang 3.3+ (FreeBSD
10+, notably)
- added new video shader, "Display Emulation", which changes the shader
based on the emulated system
- fixed the home button to go to your default library path
- phoenix: Windows port won't send onActivate unless an item is selected
(prevents crashing on pressing enter in file dialog)
- ruby: removed vec4 position from out Vertex {} (helps AMD cards)
- shaders: updated all shaders to use texture() instead of texture2D()
(helps AMD cards)
The "Display Emulation" option works like this: when selected, it tries
to load "<path>/Video Shaders/Emulation/<systemName>.shader/"; otherwise
it falls back to the blur shader. <path> is the usual (next to binary,
then in <config>/higan, then in /usr/share/higan, etc); and <systemName>
is "Famicom", "Super Famicom", "Game Boy", "Game Boy Color", "Game Boy
Advance"
To support BSD, I had to modify the $(platform) variable to
differentiate between Linux and BSD.
As such, the new $(platform) values are:
win -> windows
osx -> macosx
x -> linux or bsd
I am also checking uname -s instead of uname -a now. No reason to
potentially match the hostname to the wrong OS type.
2013-10-21 11:45:39 +00:00
|
|
|
string lstring::merge(const string& separator) const {
|
2013-05-05 09:21:30 +00:00
|
|
|
string output;
|
|
|
|
for(unsigned i = 0; i < size(); i++) {
|
|
|
|
output.append(operator[](i));
|
|
|
|
if(i < size() - 1) output.append(separator);
|
|
|
|
}
|
|
|
|
return output;
|
|
|
|
}
|
|
|
|
|
|
|
|
lstring& lstring::isort() {
|
|
|
|
nall::sort(pool, objectsize, [](const string& x, const string& y) {
|
|
|
|
return istrcmp(x, y) < 0;
|
|
|
|
});
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
lstring& lstring::strip() {
|
|
|
|
for(unsigned n = 0; n < size(); n++) {
|
|
|
|
operator[](n).strip();
|
|
|
|
}
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
template<typename... Args> void lstring::append(const string& data, Args&&... args) {
|
|
|
|
vector::append(data);
|
|
|
|
append(std::forward<Args>(args)...);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool lstring::operator==(const lstring& source) const {
|
|
|
|
if(this == &source) return true;
|
|
|
|
if(size() != source.size()) return false;
|
|
|
|
for(unsigned n = 0; n < size(); n++) {
|
|
|
|
if(operator[](n) != source[n]) return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool lstring::operator!=(const lstring& source) const {
|
|
|
|
return !operator==(source);
|
|
|
|
}
|
|
|
|
|
|
|
|
lstring& lstring::operator=(const lstring& source) {
|
|
|
|
vector::operator=(source);
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
lstring& lstring::operator=(lstring& source) {
|
|
|
|
vector::operator=(source);
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
lstring& lstring::operator=(lstring&& source) {
|
|
|
|
vector::operator=(std::move(source));
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
template<typename... Args> lstring::lstring(Args&&... args) {
|
|
|
|
append(std::forward<Args>(args)...);
|
|
|
|
}
|
|
|
|
|
|
|
|
lstring::lstring(const lstring& source) {
|
|
|
|
vector::operator=(source);
|
|
|
|
}
|
|
|
|
|
|
|
|
lstring::lstring(lstring& source) {
|
|
|
|
vector::operator=(source);
|
|
|
|
}
|
|
|
|
|
|
|
|
lstring::lstring(lstring&& source) {
|
|
|
|
vector::operator=(std::move(source));
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|