diff options
author | Bernard Normier <bernard@zeroc.com> | 2007-02-01 17:09:49 +0000 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2007-02-01 17:09:49 +0000 |
commit | abada90e3f84dc703b8ddc9efcbed8a946fadead (patch) | |
tree | 2c6f9dccd510ea97cb927a7bd635422efaae547a /cpp/demo/book/simple_filesystem/Client.cpp | |
parent | removing trace message (diff) | |
download | ice-abada90e3f84dc703b8ddc9efcbed8a946fadead.tar.bz2 ice-abada90e3f84dc703b8ddc9efcbed8a946fadead.tar.xz ice-abada90e3f84dc703b8ddc9efcbed8a946fadead.zip |
Expanded tabs into spaces
Diffstat (limited to 'cpp/demo/book/simple_filesystem/Client.cpp')
-rwxr-xr-x | cpp/demo/book/simple_filesystem/Client.cpp | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/cpp/demo/book/simple_filesystem/Client.cpp b/cpp/demo/book/simple_filesystem/Client.cpp index 870b879e0d9..00cbc8a425e 100755 --- a/cpp/demo/book/simple_filesystem/Client.cpp +++ b/cpp/demo/book/simple_filesystem/Client.cpp @@ -27,16 +27,16 @@ listRecursive(const DirectoryPrx & dir, int depth = 0) NodeSeq contents = dir->list(); for (NodeSeq::const_iterator i = contents.begin(); i != contents.end(); ++i) { - DirectoryPrx dir = DirectoryPrx::checkedCast(*i); - FilePrx file = FilePrx::uncheckedCast(*i); - cout << indent << (*i)->name() << (dir ? " (directory):" : " (file):") << endl; - if (dir) { - listRecursive(dir, depth); - } else { - Lines text = file->read(); - for (Lines::const_iterator j = text.begin(); j != text.end(); ++j) - cout << indent << "\t" << *j << endl; - } + DirectoryPrx dir = DirectoryPrx::checkedCast(*i); + FilePrx file = FilePrx::uncheckedCast(*i); + cout << indent << (*i)->name() << (dir ? " (directory):" : " (file):") << endl; + if (dir) { + listRecursive(dir, depth); + } else { + Lines text = file->read(); + for (Lines::const_iterator j = text.begin(); j != text.end(); ++j) + cout << indent << "\t" << *j << endl; + } } } @@ -46,38 +46,38 @@ main(int argc, char * argv[]) int status = 0; Ice::CommunicatorPtr ic; try { - // Create a communicator - // - ic = Ice::initialize(argc, argv); + // Create a communicator + // + ic = Ice::initialize(argc, argv); - // Create a proxy for the root directory - // - Ice::ObjectPrx base = ic->stringToProxy("RootDir:default -p 10000"); - if (!base) - throw "Could not create proxy"; + // Create a proxy for the root directory + // + Ice::ObjectPrx base = ic->stringToProxy("RootDir:default -p 10000"); + if (!base) + throw "Could not create proxy"; - // Down-cast the proxy to a Directory proxy - // - DirectoryPrx rootDir = DirectoryPrx::checkedCast(base); - if (!rootDir) - throw "Invalid proxy"; + // Down-cast the proxy to a Directory proxy + // + DirectoryPrx rootDir = DirectoryPrx::checkedCast(base); + if (!rootDir) + throw "Invalid proxy"; - // Recursively list the contents of the root directory - // - cout << "Contents of root directory:" << endl; - listRecursive(rootDir); + // Recursively list the contents of the root directory + // + cout << "Contents of root directory:" << endl; + listRecursive(rootDir); } catch (const Ice::Exception & ex) { - cerr << ex << endl; - status = 1; + cerr << ex << endl; + status = 1; } catch (const char * msg) { - cerr << msg << endl; - status = 1; + cerr << msg << endl; + status = 1; } // Clean up // if (ic) - ic->destroy(); + ic->destroy(); return status; } |