void Request::responseHeader(const string& key, const string& value)
{
if (key == "connection") {
- _willClose = (value.find("close") >= 0);
+ _willClose = (value.find("close") != string::npos);
}
_responseHeaders[key] = value;
// dummy eof routine
-bool SGIOChannel::eof() {
+bool SGIOChannel::eof() const {
return false;
}
* false.
* @return result of eof check
*/
- virtual bool eof();
+ virtual bool eof() const;
inline void set_type( SGChannelType t ) { type = t; }
inline SGChannelType get_type() const { return type; }
inline std::string get_file_name() const { return file_name; }
/** @return true of eof conditions exists */
- inline bool eof() const { return eof_flag; };
+ virtual bool eof() const { return eof_flag; };
};
return path;
}
- if (index >= 0) {
+ if (index != string::npos) {
return path.substr(0, index);
} else {
return path;
}
string::size_type firstDot = path.find(".", index);
- if ((firstDot >= 0) && (path.find(sgDirPathSep, firstDot) == string::npos)) {
+ if ((firstDot != string::npos) && (path.find(sgDirPathSep, firstDot) == string::npos)) {
return boost::to_lower_copy(path.substr(firstDot + 1));
} else {
return "";
std::string dir() const;
/**
- * Get the base part of the path (everything but the extension.)
+ * Get the base part of the path (everything but the final extension.)
* @return the base string
*/
std::string base() const;
std::streampos
-gzfilebuf::seekoff( std::streamoff, ios_seekdir, int )
+gzfilebuf::seekoff( std::streamoff, ios_seekdir, ios_openmode )
{
return std::streampos(EOF);
}
bool is_open() const { return (file != NULL); }
/** @return stream position */
- virtual std::streampos seekoff( std::streamoff off, ios_seekdir way, int which );
+ virtual std::streampos seekoff( std::streamoff off, ios_seekdir way, ios_openmode which );
/** sync the stream */
virtual int sync();