41 lines
		
	
	
		
			583 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			41 lines
		
	
	
		
			583 B
		
	
	
	
		
			C++
		
	
	
	
	
	
//
 | 
						|
// fdstream.cpp
 | 
						|
// libscio
 | 
						|
//
 | 
						|
// Created by Bob Polis at 2020-04-25
 | 
						|
// Copyright (c) 2020 SwiftCoder. All rights reserved.
 | 
						|
//
 | 
						|
 | 
						|
#include "libscio.hpp"
 | 
						|
#include <unistd.h>
 | 
						|
 | 
						|
sc::io::fdostream::~fdostream() {
 | 
						|
	close();
 | 
						|
}
 | 
						|
 | 
						|
void sc::io::fdostream::close() {
 | 
						|
	if (_outbuf.fd() != -1) {
 | 
						|
		::close(_outbuf.fd());
 | 
						|
	}
 | 
						|
}
 | 
						|
 | 
						|
sc::io::fdistream::~fdistream() {
 | 
						|
	close();
 | 
						|
}
 | 
						|
 | 
						|
void sc::io::fdistream::close() {
 | 
						|
	if (_inbuf.fd() != -1) {
 | 
						|
		::close(_inbuf.fd());
 | 
						|
	}
 | 
						|
}
 | 
						|
 | 
						|
sc::io::fdstream::~fdstream() {
 | 
						|
	close();
 | 
						|
}
 | 
						|
 | 
						|
void sc::io::fdstream::close() {
 | 
						|
	if (_iobuf.fd() != -1) {
 | 
						|
		::close(_iobuf.fd());
 | 
						|
	}
 | 
						|
}
 |