本文整理汇总了C++中FileStore::size方法的典型用法代码示例。如果您正苦于以下问题:C++ FileStore::size方法的具体用法?C++ FileStore::size怎么用?C++ FileStore::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileStore
的用法示例。
在下文中一共展示了FileStore::size方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initTester
//---------------------------------------------------------------------------
int FileStore_T :: testEverything()
{
TestUtil initTester( "FileStore", "initialization", __FILE__, __LINE__ );
TestUtil sizeTester( "FileStore", "size", __FILE__, __LINE__ );
TestUtil nfilesTester( "FileStore", "nfiles", __FILE__, __LINE__ );
TestUtil clearTester( "FileStore", "clear", __FILE__, __LINE__ );
TestUtil getTester( "FileStore", "getFilenames", __FILE__, __LINE__ );
TestUtil addTester( "FileStore", "addFile", __FILE__, __LINE__ );
TestUtil headerTester( "FileStore", "getHeader", __FILE__, __LINE__ );
try // default initialization
{
FileStore<TestHeaderType> store;
initTester.assert( true, "unexpected exception", __LINE__ );
}
catch (...)
{
initTester.assert( false, "unexpected exception", __LINE__ );
}
FileStore<TestHeaderType> store; // Use this for the remaining tests
try // empty store (size)
{
sizeTester.assert( (0 == store.size() ), "empty store expected", __LINE__ );
}
catch (...)
{
sizeTester.assert( false, "unexpected exception", __LINE__ );
}
try // empty store (nfiles)
{
nfilesTester.assert( (0 == store.nfiles() ), "empty store expected", __LINE__ );
}
catch (...)
{
nfilesTester.assert( false, "unexpected exception", __LINE__ );
}
try // empty store (getFilenames)
{
getTester.assert( (0 == store.getFileNames().size() ), "empty store expected", __LINE__ );
}
catch (...)
{
getTester.assert( false, "unexpected exception", __LINE__ );
}
try // empty store (clear)
{
store.clear();
clearTester.assert( true, "unexpected exception", __LINE__ );
}
catch (...)
{
clearTester.assert( false, "unexpected exception", __LINE__ );
}
try // empty store (getHeader)
{
const TestHeaderType& header = store.getHeader("filename");
headerTester.assert( false, "expected exception", __LINE__ );
}
catch (InvalidRequest& ire)
{
headerTester.assert( true, "expected exception", __LINE__ );
}
catch (...)
{
headerTester.assert( false, "unexpected exception", __LINE__ );
}
try // empty store (addFile)
{
TestHeaderType header(1);
store.addFile("testfile1", header);
addTester.assert( true, "unexpected exception", __LINE__ );
sizeTester.assert( (1 == store.size() ), "single file expected", __LINE__ );
nfilesTester.assert( (1 == store.nfiles() ), "single file expected", __LINE__ );
std::vector<std::string> filenames = store.getFileNames();
getTester.assert( (1 == filenames.size() ), "single file expected", __LINE__ );
if (filenames.size() > 0)
{
getTester.assert( (0 == filenames[0].compare("testfile1") ), "unexpected filename", __LINE__ );
}
}
catch (...)
{
addTester.assert( false, "unexpected exception", __LINE__ );
}
try // non-empty store (getHeader, present)
{
const TestHeaderType& header = store.getHeader("testfile1");
headerTester.assert( true, "unexpected exception", __LINE__ );
headerTester.assert( (1 == header.value), "unexpected header", __LINE__ );
//.........这里部分代码省略.........
示例2: throw
/// Get number of SP3 files in FileStore.
int nSP3files(void) throw()
{ return SP3Files.size(); }
示例3: nClockfiles
/// Get number of clock files in FileStore.
int nClockfiles(void) throw()
{ return (useSP3clock ? SP3Files.size() : clkFiles.size()); }
示例4: nfiles
/// Get number of files (all types) in FileStore.
int nfiles(void) throw()
{ return (SP3Files.size() + (useSP3clock ? 0 : clkFiles.size())); }