Update to v099r16 release (public beta).

byuu says:

Changelog:
- hiro: BrowserDialog can navigate up to drive selection on Windows
- nall: (file,path,dir,base,prefix,suffix)name =>
  Location::(file,path,dir,base,prefix,suffix)
- higan/tomoko: rename audio filter label from "Sinc" to "IIR - Biquad"
- higan/tomoko: allow loading files via icarus on the command-line
  once again
- higan/tomoko: (begrudging) quick hack to fix presentation window focus
  on startup
- higan/audio: don't divide output audio volume by number of streams
- processor/r65816: fix a regression in (read,write)DB; fixes Taz-Mania
- fixed compilation regressions on Windows and Linux

I'm happy with where we are at with code cleanups and stability, so I'd
like to release v100. But even though I'm not assigning any special
significance to this version, we should probably test it more thoroughly
first.
This commit is contained in:
Tim Allen
2016-07-04 21:53:24 +10:00
parent 8d5cc0c35e
commit 13ad9644a2
34 changed files with 102 additions and 84 deletions

View File

@@ -1,72 +0,0 @@
#pragma once
namespace nall {
// (/parent/child.type/)
// (/parent/child.type/)name.type
auto pathname(string_view self) -> string {
const char* p = self.data() + self.size() - 1;
for(int offset = self.size() - 1; offset >= 0; offset--, p--) {
if(*p == '/') return slice(self, 0, offset + 1);
}
return ""; //no path found
}
// /parent/child.type/()
// /parent/child.type/(name.type)
auto filename(string_view self) -> string {
const char* p = self.data() + self.size() - 1;
for(int offset = self.size() - 1; offset >= 0; offset--, p--) {
if(*p == '/') return slice(self, offset + 1);
}
return self; //no path found
}
// (/parent/)child.type/
// (/parent/child.type/)name.type
auto dirname(string_view self) -> string {
const char* p = self.data() + self.size() - 1, *last = p;
for(int offset = self.size() - 1; offset >= 0; offset--, p--) {
if(*p == '/' && p == last) continue;
if(*p == '/') return slice(self, 0, offset + 1);
}
return ""; //no path found
}
// /parent/(child.type/)
// /parent/child.type/(name.type)
auto basename(string_view self) -> string {
const char* p = self.data() + self.size() - 1, *last = p;
for(int offset = self.size() - 1; offset >= 0; offset--, p--) {
if(*p == '/' && p == last) continue;
if(*p == '/') return slice(self, offset + 1);
}
return self; //no path found
}
// /parent/(child).type/
// /parent/child.type/(name).type
auto prefixname(string_view self) -> string {
const char* p = self.data() + self.size() - 1, *last = p;
for(int offset = self.size() - 1, suffix = -1; offset >= 0; offset--, p--) {
if(*p == '/' && p == last) continue;
if(*p == '/') return slice(self, offset + 1, suffix >= 0 ? suffix - offset - 1 : 0).trimRight("/");
if(*p == '.' && suffix == -1) { suffix = offset; continue; }
if(offset == 0) return slice(self, offset, suffix).trimRight("/");
}
return ""; //no prefix found
}
// /parent/child(.type)/
// /parent/child.type/name(.type)
auto suffixname(string_view self) -> string {
const char* p = self.data() + self.size() - 1, *last = p;
for(int offset = self.size() - 1; offset >= 0; offset--, p--) {
if(*p == '/' && p == last) continue;
if(*p == '/') break;
if(*p == '.') return slice(self, offset).trimRight("/");
}
return ""; //no suffix found
}
}

View File

@@ -4,6 +4,8 @@
* revision 0.02
*/
#include <nall/location.hpp>
namespace nall { namespace {
struct CML {
@@ -33,7 +35,7 @@ private:
};
auto CML::parse(const string& filename) -> string {
if(!settings.path) settings.path = pathname(filename);
if(!settings.path) settings.path = Location::path(filename);
string document = settings.reader ? settings.reader(filename) : string::read(filename);
parseDocument(document, settings.path, 0);
return state.output;
@@ -61,7 +63,7 @@ auto CML::parseDocument(const string& filedata, const string& pathname, uint dep
name.trimLeft("include ", 1L);
string filename{pathname, name};
string document = settings.reader ? settings.reader(filename) : string::read(filename);
parseDocument(document, nall::pathname(filename), depth + 1);
parseDocument(document, Location::path(filename), depth + 1);
continue;
}

View File

@@ -4,6 +4,8 @@
* revision 0.03
*/
#include <nall/location.hpp>
namespace nall { namespace {
struct DML {
@@ -45,7 +47,7 @@ auto DML::parse(const string& filedata, const string& pathname) -> string {
}
auto DML::parse(const string& filename) -> string {
if(!settings.path) settings.path = pathname(filename);
if(!settings.path) settings.path = Location::path(filename);
string document = settings.reader ? settings.reader(filename) : string::read(filename);
parseDocument(document, settings.path, 0);
return state.output;
@@ -68,7 +70,7 @@ auto DML::parseBlock(string& block, const string& pathname, uint depth) -> bool
if(block.beginsWith("<include ") && block.endsWith(">")) {
string filename{pathname, block.trim("<include ", ">", 1L).strip()};
string document = settings.reader ? settings.reader(filename) : string::read(filename);
parseDocument(document, nall::pathname(filename), depth + 1);
parseDocument(document, Location::path(filename), depth + 1);
}
//html