Skip to content

Commit

Permalink
files: add method to check if a file is valid
Browse files Browse the repository at this point in the history
Signed-off-by: Sébastien Boisvert <[email protected]>
  • Loading branch information
Sébastien Boisvert committed Nov 7, 2013
1 parent b862e4a commit 185394f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 4 additions & 2 deletions RayPlatform/core/ComputeCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1209,8 +1209,10 @@ void ComputeCore::configureEngine() {
headerSize += ( 1 * sizeof(uint32_t) * sizeof(char) );
*/

/*
cout << "DEBUG MAXIMUM_MESSAGE_SIZE_IN_BYTES " << MAXIMUM_MESSAGE_SIZE_IN_BYTES;
cout << " headerSize " << headerSize << endl;
*/

// align this on 8 bytes because there is still something in the code
// that is incorrect apparently.
Expand All @@ -1234,12 +1236,12 @@ void ComputeCore::configureEngine() {
headerSize += toAdd;
}

cout << " headerSize (with padding) " << headerSize << endl;
//cout << " headerSize (with padding) " << headerSize << endl;

maximumMessageSizeInBytes += headerSize;
}

cout << "DEBUG maximumMessageSizeInBytes " << maximumMessageSizeInBytes << endl;
//cout << "DEBUG maximumMessageSizeInBytes " << maximumMessageSizeInBytes << endl;

#ifdef CONFIG_ASSERT
assert(maximumMessageSizeInBytes >= MAXIMUM_MESSAGE_SIZE_IN_BYTES);
Expand Down
4 changes: 4 additions & 0 deletions RayPlatform/files/FileReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,7 @@ bool FileReader::eof() {
//return m_reader.eof();
}

bool FileReader::isValid() {

return m_reader.good();
}
1 change: 1 addition & 0 deletions RayPlatform/files/FileReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class FileReader {
void getline(char * buffer, int size);
void close();
bool eof();
bool isValid();
};

#endif

0 comments on commit 185394f

Please sign in to comment.