Changed filename saving.
This commit is contained in:
parent
a4bfb515fd
commit
5a32aed258
|
@ -24,6 +24,9 @@
|
||||||
History
|
History
|
||||||
|
|
||||||
$Log: not supported by cvs2svn $
|
$Log: not supported by cvs2svn $
|
||||||
|
Revision 1.2 2004/06/25 16:47:13 ponchio
|
||||||
|
Various debug
|
||||||
|
|
||||||
Revision 1.1 2004/06/24 14:32:45 ponchio
|
Revision 1.1 2004/06/24 14:32:45 ponchio
|
||||||
Moved from wrap/nexus
|
Moved from wrap/nexus
|
||||||
|
|
||||||
|
@ -67,7 +70,7 @@ template <class Partition> class PChain {
|
||||||
return levels[level].Priority(level, p, key);
|
return levels[level].Priority(level, p, key);
|
||||||
}
|
}
|
||||||
bool Save(const std::string &file) {
|
bool Save(const std::string &file) {
|
||||||
FILE *fp = fopen(file.c_str(), "wb+");
|
FILE *fp = fopen((file + ".chn").c_str(), "wb+");
|
||||||
if(!fp) return false;
|
if(!fp) return false;
|
||||||
int n = Levels();
|
int n = Levels();
|
||||||
fwrite(&n, sizeof(int), 1, fp);
|
fwrite(&n, sizeof(int), 1, fp);
|
||||||
|
@ -78,7 +81,7 @@ template <class Partition> class PChain {
|
||||||
}
|
}
|
||||||
bool Load(const std::string &file) {
|
bool Load(const std::string &file) {
|
||||||
levels.clear();
|
levels.clear();
|
||||||
FILE *fp = fopen(file.c_str(), "rb");
|
FILE *fp = fopen((file + ".chn").c_str(), "rb");
|
||||||
if(!fp) return false;
|
if(!fp) return false;
|
||||||
int n;
|
int n;
|
||||||
fread(&n, sizeof(int), 1, fp);
|
fread(&n, sizeof(int), 1, fp);
|
||||||
|
|
Loading…
Reference in New Issue