summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util/chdcd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/util/chdcd.c')
-rw-r--r--src/lib/util/chdcd.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/lib/util/chdcd.c b/src/lib/util/chdcd.c
index 0720a6b9aa0..992c95bfeae 100644
--- a/src/lib/util/chdcd.c
+++ b/src/lib/util/chdcd.c
@@ -38,13 +38,13 @@ static char linebuffer[512];
IMPLEMENTATION
***************************************************************************/
-static astring get_file_path(astring &path)
+static std::string get_file_path(std::string &path)
{
- int pos = path.rchr( 0, '\\');
+ int pos = path.find_last_of('\\');
if (pos!=-1) {
path = path.substr(0,pos+1);
} else {
- pos = path.rchr( 0, '/');
+ pos = path.find_last_of('/');
path = path.substr(0,pos+1);
}
return path;
@@ -360,7 +360,7 @@ chd_error chdcd_parse_nero(const char *tocfname, cdrom_toc &outtoc, chdcd_track_
UINT32 chain_offs, chunk_size;
int done = 0;
- astring path = astring(tocfname);
+ std::string path = std::string(tocfname);
infile = fopen(tocfname, "rb");
path = get_file_path(path);
@@ -437,7 +437,7 @@ chd_error chdcd_parse_nero(const char *tocfname, cdrom_toc &outtoc, chdcd_track_
track_end = read_uint64(infile);
// printf("Track %d: sector size %d mode %x index0 %llx index1 %llx track_end %llx (pregap %d sectors, length %d sectors)\n", track, size, mode, index0, index1, track_end, (UINT32)(index1-index0)/size, (UINT32)(track_end-index1)/size);
- outinfo.track[track-1].fname.cpy(tocfname);
+ outinfo.track[track-1].fname.assign(tocfname);
outinfo.track[track-1].offset = offset + (UINT32)(index1-index0);
outinfo.track[track-1].idx0offs = 0;
outinfo.track[track-1].idx1offs = 0;
@@ -530,7 +530,7 @@ chd_error chdcd_parse_nero(const char *tocfname, cdrom_toc &outtoc, chdcd_track_
chd_error chdcd_parse_iso(const char *tocfname, cdrom_toc &outtoc, chdcd_track_input_info &outinfo)
{
FILE *infile;
- astring path = astring(tocfname);
+ std::string path = std::string(tocfname);
infile = fopen(tocfname, "rb");
path = get_file_path(path);
@@ -597,7 +597,7 @@ static chd_error chdcd_parse_gdi(const char *tocfname, cdrom_toc &outtoc, chdcd_
FILE *infile;
int i, numtracks;
- astring path = astring(tocfname);
+ std::string path = std::string(tocfname);
infile = fopen(tocfname, "rt");
path = get_file_path(path);
@@ -663,7 +663,7 @@ static chd_error chdcd_parse_gdi(const char *tocfname, cdrom_toc &outtoc, chdcd_
outinfo.track[trknum].swap = true;
}
- astring name;
+ std::string name;
tok=strtok(NULL," ");
name = tok;
@@ -675,9 +675,9 @@ static chd_error chdcd_parse_gdi(const char *tocfname, cdrom_toc &outtoc, chdcd_
name += tok;
}
} while(tok!=NULL && (strrchr(tok,'"')-tok !=(strlen(tok)-1)));
- name = name.delchr('"');
+ strdelchr(name,'"');
}
- outinfo.track[trknum].fname.cpy(path).cat(name);
+ outinfo.track[trknum].fname.assign(path).append(name);
sz = get_file_size(outinfo.track[trknum].fname.c_str());
@@ -717,9 +717,9 @@ chd_error chdcd_parse_cue(const char *tocfname, cdrom_toc &outtoc, chdcd_track_i
FILE *infile;
int i, trknum;
static char token[512];
- astring lastfname;
+ std::string lastfname;
UINT32 wavlen, wavoffs;
- astring path = astring(tocfname);
+ std::string path = std::string(tocfname);
infile = fopen(tocfname, "rt");
path = get_file_path(path);
@@ -753,7 +753,7 @@ chd_error chdcd_parse_cue(const char *tocfname, cdrom_toc &outtoc, chdcd_track_i
TOKENIZE
/* keep the filename */
- lastfname.cpy(path).cat(token);
+ lastfname.assign(path).append(token);
/* get the file type */
TOKENIZE
@@ -810,7 +810,7 @@ chd_error chdcd_parse_cue(const char *tocfname, cdrom_toc &outtoc, chdcd_track_i
outinfo.track[trknum].idx0offs = -1;
outinfo.track[trknum].idx1offs = 0;
- outinfo.track[trknum].fname.cpy(lastfname); // default filename to the last one
+ outinfo.track[trknum].fname.assign(lastfname); // default filename to the last one
// printf("trk %d: fname %s offset %d\n", trknum, outinfo.track[trknum].fname.c_str(), outinfo.track[trknum].offset);
@@ -925,7 +925,7 @@ chd_error chdcd_parse_cue(const char *tocfname, cdrom_toc &outtoc, chdcd_track_i
if (trknum == (outtoc.numtrks-1))
{
/* if we have the same filename as the last track, do it that way */
- if (trknum != 0 && outinfo.track[trknum].fname == outinfo.track[trknum-1].fname)
+ if (trknum != 0 && (outinfo.track[trknum].fname.compare(outinfo.track[trknum-1].fname)==0))
{
tlen = get_file_size(outinfo.track[trknum].fname.c_str());
if (tlen == 0)
@@ -952,7 +952,7 @@ chd_error chdcd_parse_cue(const char *tocfname, cdrom_toc &outtoc, chdcd_track_i
else
{
/* if we have the same filename as the next track, do it that way */
- if (outinfo.track[trknum].fname == outinfo.track[trknum+1].fname)
+ if (outinfo.track[trknum].fname.compare(outinfo.track[trknum+1].fname)==0)
{
outtoc.tracks[trknum].frames = outinfo.track[trknum+1].idx0offs - outinfo.track[trknum].idx0offs;
@@ -1028,7 +1028,7 @@ chd_error chdcd_parse_toc(const char *tocfname, cdrom_toc &outtoc, chdcd_track_i
return chdcd_parse_iso(tocfname, outtoc, outinfo);
}
- astring path = astring(tocfname);
+ std::string path = std::string(tocfname);
infile = fopen(tocfname, "rt");
path = get_file_path(path);
@@ -1064,7 +1064,7 @@ chd_error chdcd_parse_toc(const char *tocfname, cdrom_toc &outtoc, chdcd_track_i
TOKENIZE
/* keep the filename */
- outinfo.track[trknum].fname.cpy(path).cat(token);
+ outinfo.track[trknum].fname.assign(path).append(token);
/* get either the offset or the length */
TOKENIZE