initial commit for version 1.5.x patch release
[OpenFOAM-1.5.x.git] / applications / test / prefixOSstream / prefixOSstreamTest.C
blobe05b76e7b64debc1f5de203f343c1ffbbcaf6be8
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2008 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
11     OpenFOAM is free software; you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
16     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Application
26     prefixOSstreamTest
28 Description
30 \*---------------------------------------------------------------------------*/
32 #include "OSspecific.H"
34 #include "IOstreams.H"
35 #include "IStringStream.H"
36 #include "scalar.H"
37 #include "vector.H"
38 #include "ListOps.H"
39 #include "Pstream.H"
40 #include "argList.H"
42 using namespace Foam;
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 //  Main program:
47 int main(int argc, char *argv[])
49     argList::validArgs.clear();
50     argList args(argc, argv);
52     //Pout.prefix() = '[' + name(Pstream::myProcNo()) + "] ";
54     List<vector> list(IStringStream("1 ((0 1 2))")());
55     Info<< list << endl;
57     List<vector> list2
58     (
59         IStringStream
60         (
61             "(\
62                  (0 1 2)\
63                  (3 4 5)\
64                  (3 4 5)\
65                  (3 4 5)\
66                  (3 4 5)\
67                  (3 4 5)\
68                  (3 4 5)\
69                  (3 4 5)\
70                  (3 4 5)\
71                  (3 4 5)\
72                  (3 4 5)\
73                  (3 4 5)\
74                  (3 4 5)\
75                  (3 4 5)\
76              )"
77         )()
78     );
79     Pout<< list2 << endl;
81     Info<< findIndex(list2, vector(3, 4, 5)) << endl;
83     return 0;
87 // ************************************************************************* //