Vault  4.1
vabstractfilestream.cpp
Go to the documentation of this file.
00001 /*
00002 Copyright c1997-2014 Trygve Isaacson. All rights reserved.
00003 This file is part of the Code Vault version 4.1
00004 http://www.bombaydigital.com/
00005 License: MIT. See LICENSE.md in the Vault top level directory.
00006 */
00007 
00010 #include "vabstractfilestream.h"
00011 #include "vtypes_internal_platform.h"
00012 
00013 #include "vexception.h"
00014 
00015 VAbstractFileStream::VAbstractFileStream()
00016     : mNode() // -> empty path
00017     {
00018 }
00019 
00020 VAbstractFileStream::VAbstractFileStream(const VFSNode& node)
00021     : mNode(node)
00022     {
00023     node.getName(mName); // set the stream name for debugging use
00024 }
00025 
00026 void VAbstractFileStream::setNode(const VFSNode& node) {
00027     mNode = node;
00028     node.getName(mName);
00029 }
00030 
00031 const VFSNode& VAbstractFileStream::getNode() const {
00032     return mNode;
00033 }
00034 
00035 void VAbstractFileStream::_throwIfOpenFailed(const VString& failedMethod, const VString& path) {
00036     if (! this->isOpen()) {
00037         throw VException(VSystemError(), VSTRING_FORMAT("%s failed to open '%s'.", failedMethod.chars(), path.chars()));
00038     }
00039 }
00040 

Copyright ©1997-2014 Trygve Isaacson. All rights reserved. This documentation was generated with Doxygen.