Changeset 39

Show
Ignore:
Timestamp:
04/30/08 17:48:03 (4 years ago)
Author:
aarti_pl
Message:

- updated licences
- database package updates

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/doost/api/Common.d

    r38 r39  
    77    Authors:    Marcin Kuszczak, www.zapytajmnie.com (author's christian site) 
    88 
    9     Version:    0.9.0 
    10     Date:       18 Jan 2008 
     9    Version:    0.9.1 
     10    Date:       30-Apr-2008 
    1111 
    12     History:    0.9.0  -   initial public beta version 
     12    History:    0.9.1 (30-Apr-2008)    -   initial public version 
    1313 
    1414 ******************************************************************************/ 
  • trunk/doost/core/Any.d

    r38 r39  
    99                library named 'any' created by Kevlin Henney. 
    1010 
    11     Version:    0.9.0 
    12     Date:       08 Oct 2007 
    13  
    14     History:    0.9.0  -   initial public beta version 
     11    Version:    0.9.1 
     12    Date:       30-Apr-2008 
     13 
     14    History:    0.9.0 (08-Oct-2007)    -   initial public version 
    1515 
    1616 ******************************************************************************/ 
  • trunk/doost/core/Traits.d

    r37 r39  
    77    Authors:    Marcin Kuszczak, www.zapytajmnie.com (author's christian site) 
    88 
    9     Version:    0.9.0 
    10     Date:       18 Jan 2008 
    11  
    12     History:    0.9.0  -   initial public beta version 
     9    Version:    0.9.1 
     10    Date:       30-Apr-2008 
     11 
     12    History:    0.9.1 (30-Apr-2008)    -   initial public version 
    1313 
    1414 ******************************************************************************/ 
     
    201201} 
    202202 
     203/******************************************************************************* 
     204        Below templates are hacks for use with static arrays 
     205 ******************************************************************************/ 
     206private template normalizedType(T : U[N], U, size_t N) { 
     207    alias U[] normalizedType; 
     208} 
     209 
     210private template normalizedType(T) { 
     211    alias T normalizedType; 
     212} 
  • trunk/doost/database/Column.d

    r38 r39  
     1/******************************************************************************* 
     2 
     3    License:    Boost Software License, v. 1.0 
     4                Academic Free License, v. 3.0 
     5                BSD License 
     6 
     7    Authors:    Marcin Kuszczak, www.zapytajmnie.com (author's christian site) 
     8 
     9    Version:    0.9.1 
     10    Date:       30-Apr-2008 
     11 
     12    History:    0.9.1 (30-Apr-2008) -   initial public version 
     13 
     14 ******************************************************************************/ 
    115 
    216module doost.database.Column; 
    317 
    418import doost.api.Common; 
     19import doost.core.Traits; 
    520import doost.database.Recordset; 
    621import doost.database.Expression; 
     
    823import doost.database.Table; 
    924 
    10 abstract class Column { 
    11     Table table; 
     25/******************************************************************************* 
     26 ******************************************************************************/ 
     27public abstract class Column { 
     28public: 
     29    Table table; 
    1230    string name; 
    1331    string type; 
    14      
    15     void accept(Visitor visitor) { 
    16         visitor.columnInfo(type, name); 
    17     } 
    1832} 
    1933 
    20 class TypedColumn(T) : Column { 
    21     alias T TYPE; 
     34/******************************************************************************* 
     35 ******************************************************************************/ 
     36public class TypedColumn(T, U) : Column { 
     37    alias T TABLE_TYPE; 
     38    alias normalizedType!(U) VALUE_TYPE; 
    2239 
    23     Expression opEquals(T o) { 
    24         return new Expression(); 
    25     } 
    26  
    27     this(Table tb, string nm, string tp) { 
     40    public this(Table tb, string nm, string tp) { 
    2841        table = tb; 
    2942        name = nm; 
     
    3245} 
    3346 
    34 TypedColumn!(long) COLUMN0; 
     47//TypedColumn!(long) COLUMN0; 
  • trunk/doost/database/Expression.d

    r38 r39  
     1/******************************************************************************* 
     2 
     3    License:    Boost Software License, v. 1.0 
     4                Academic Free License, v. 3.0 
     5                BSD License 
     6 
     7    Authors:    Marcin Kuszczak, www.zapytajmnie.com (author's christian site) 
     8 
     9    Version:    0.9.1 
     10    Date:       30-Apr-2008 
     11 
     12    History:    0.9.1 (30-Apr-2008) -   initial public version 
     13 
     14 ******************************************************************************/ 
    115 
    216module doost.database.Expression; 
    317 
    418import doost.api.Common; 
     19import doost.database.Column; 
     20 
     21enum ExType {Equals} 
     22 
     23/******************************************************************************* 
     24 ******************************************************************************/ 
     25class Expression { 
    526 
    627 
    7 class Expression { 
    8     enum {Equals}; 
    9  
    10     this() { 
     28    this(ExType type) { 
     29        m_type = type; 
    1130    } 
    1231 
     
    1433        return "OK!"; 
    1534    } 
     35private: 
     36    ExType m_type; 
    1637} 
     38 
     39DataColumn!(T.VALUE_TYPE) column(T)(T col) { 
     40    static assert(is(T : Column)); 
     41    return new DataColumn!(T.VALUE_TYPE); 
     42} 
     43 
     44Expression leq(T, U)(T column, U value) { 
     45    pragma(msg, T.stringof ~ " " ~ U.stringof ~ " " ~ T.VALUE_TYPE.stringof); 
     46    static assert(is(T : Column) && !is(T == Column) && is(U : T.VALUE_TYPE)); 
     47    //static assert(is(T == Column) && is(U : char[])); 
     48 
     49    return new Expression(ExType.Equals); 
     50} 
     51 
     52Expression land(T, U)(T column, U value) { 
     53    return null; 
     54} 
  • trunk/doost/database/Recordset.d

    r38 r39  
     1/******************************************************************************* 
     2 
     3    License:    Boost Software License, v. 1.0 
     4                Academic Free License, v. 3.0 
     5                BSD License 
     6 
     7    Authors:    Marcin Kuszczak, www.zapytajmnie.com (author's christian site) 
     8 
     9    Version:    0.9.1 
     10    Date:       30-Apr-2008 
     11 
     12    History:    0.9.1 (30-Apr-2008) -   initial public version 
     13 
     14 ******************************************************************************/ 
    115 
    216module doost.database.Recordset; 
    317 
     18import std2.conv; 
     19 
     20import dbi.Row; 
     21 
     22import doost.core.Any; 
    423import doost.api.Common; 
    524import doost.database.Column; 
    625 
     26 
    727class DataColumn(T) { 
    8     //prywatny konstruktor 
     28    private this(Row[] rows, string col) { 
     29        this.rows = rows; 
     30        this.col = col; 
     31    } 
     32 
    933    T row(uint row) { 
    10         return T.init
     34        return to!(T)(rows[row][col])
    1135    } 
    1236 
    1337    string asString(uint row) { 
    14         return ""; //to!(string)() 
    15     } 
    16 
    17  
    18 class DataRow { 
    19     T.TYPE column(T)(T col) { 
    20         static assert(is(T : Column)); 
    21         return T.TYPE.init; 
     38        return rows[row][col]; 
    2239    } 
    2340 
    24  
     41    private Row[] rows; 
     42    private string col; 
    2543} 
    2644 
    2745//TODO: prywatny konstruktor; moÅŒliwość utworzenia tylko w warstwie bazy danych 
    2846 
     47/******************************************************************************* 
     48 ******************************************************************************/ 
    2949class Recordset { 
    30     DataColumn!(T.TYPE) column(T)(T col) { 
     50    package this(Row[] rows) { 
     51        this.rows = rows; 
     52    } 
     53 
     54    DataColumn!(T.VALUE_TYPE) column(T)(T col) { 
    3155        static assert(is(T : Column)); 
    32         return new DataColumn!(T.TYPE); 
     56 
     57        //string column = col.table.name ~ "." ~ col.name; 
     58        string column = col.name; 
     59        return new DataColumn!(T.VALUE_TYPE)(rows, column); 
    3360    } 
    3461 
    35     DataRow row(uint r) { 
    36         return new DataRow()
     62    uint length() { 
     63       return rows.length
    3764    } 
     65 
     66    private Row[] rows; 
    3867} 
  • trunk/doost/database/Schema.d

    r38 r39  
     1/******************************************************************************* 
     2 
     3    License:    Boost Software License, v. 1.0 
     4                Academic Free License, v. 3.0 
     5                BSD License 
     6 
     7    Authors:    Marcin Kuszczak, www.zapytajmnie.com (author's christian site) 
     8 
     9    Version:    0.9.1 
     10    Date:       30-Apr-2008 
     11 
     12    History:    0.9.1 (30-Apr-2008) -   initial public version 
     13 
     14 ******************************************************************************/ 
    115 
    216module doost.database.Schema; 
     
    7084 
    7185    foreach(f; fields) { 
    72         baseCols ~= "\tm_columns = m_columns ~ cast(Column*)&" ~ f.name ~ ";\n"; 
    73         typedCols ~= "\tTypedColumn!(" ~ f.type ~ ") " ~ f.name ~ ";\n"; 
     86        baseCols ~= "\tpcolumns = pcolumns ~ cast(Column*)&" ~ f.name ~ ";\n"; 
     87        typedCols ~= "\tTypedColumn!(__" ~ table ~ ", " ~ f.type ~ ") " ~ f.name ~ ";\n"; 
    7488    } 
    7589 
     
    97111    result ~= "\t" ~ table ~ " = new __" ~ table ~ ";\n"; 
    98112    foreach(f; fields) { 
    99         result ~= "\t" ~ table ~ "." ~ f.name ~ " = new TypedColumn!(" ~ f.type ~ 
     113        result ~= "\t" ~ table ~ "." ~ f.name ~ " = new TypedColumn!(__" ~ table ~ ", " ~ f.type ~ 
    100114        ")("~table ~ ", \"" ~ f.name ~ "\", \"" ~ f.type ~ "\");\n"; 
    101115    } 
     
    104118} 
    105119 
     120/******************************************************************************* 
     121 ******************************************************************************/ 
    106122string schema(string s) { 
    107123    //BUG: no way to break ctfe function (neither exception nor static assert) 
  • trunk/doost/database/Sql.d

    r38 r39  
     1/******************************************************************************* 
     2 
     3    License:    Boost Software License, v. 1.0 
     4                Academic Free License, v. 3.0 
     5                BSD License 
     6 
     7    Authors:    Marcin Kuszczak, www.zapytajmnie.com (author's christian site) 
     8 
     9    Version:    0.9.1 
     10    Date:       30-Apr-2008 
     11 
     12    History:    0.9.1 (30-Apr-2008) -   initial public version 
     13 
     14 ******************************************************************************/ 
    115 
    216module doost.database.Sql; 
    317 
    418import doost.database.Visitor; 
     19import doost.database.Element; 
    520 
    6 abstract class Sql { 
    7     void accept(Visitor visitor); 
     21public import doost.database.SqlSelect; 
     22public import doost.database.SqlCreate; 
     23public import doost.database.SqlInsert; 
     24 
     25//------------------------------------------------------------------------------ 
     26 
     27/******************************************************************************* 
     28 ******************************************************************************/ 
     29public abstract class Sql : Element { 
     30    public abstract override void accept(Visitor visitor); 
    831} 
    932 
  • trunk/doost/database/SqlCreate.d

    r38 r39  
     1/******************************************************************************* 
     2 
     3    License:    Boost Software License, v. 1.0 
     4                Academic Free License, v. 3.0 
     5                BSD License 
     6 
     7    Authors:    Marcin Kuszczak, www.zapytajmnie.com (author's christian site) 
     8 
     9    Version:    0.9.1 
     10    Date:       30-Apr-2008 
     11 
     12    History:    0.9.1 (30-Apr-2008) -   initial public version 
     13 
     14 ******************************************************************************/ 
    115 
    216module doost.database.SqlCreate; 
     
    1024import doost.database.Visitor; 
    1125 
    12 SqlCreate Create(Table tbl) { 
    13     return new SqlCreate(tbl); 
     26/******************************************************************************* 
     27 ******************************************************************************/ 
     28public SqlCreate Create(Table table) { 
     29    return new SqlCreate(table); 
    1430} 
    1531 
    16 class SqlCreate : Sql { 
    17     this(Table tbl) { 
    18         m_table = tbl
     32public class SqlCreate : Sql { 
     33    public this(Table table) { 
     34        this.table = table
    1935    } 
    2036 
    21     void accept(Visitor visitor) { 
    22         visitor.visit(this); 
    23         m_table.accept(visitor); 
     37    public override void accept(Visitor visitor) { 
     38        visitor.visit(this); 
    2439    } 
    2540 
    26     Table m_table; 
     41    SqlCreate IfNotExists() { 
     42        alwaysCreate = false; 
     43        return this; 
     44    } 
     45 
     46    package Table table; 
     47    package bool alwaysCreate = true; 
    2748} 
  • trunk/doost/database/SqlSelect.d

    r38 r39  
     1/******************************************************************************* 
     2 
     3    License:    Boost Software License, v. 1.0 
     4                Academic Free License, v. 3.0 
     5                BSD License 
     6 
     7    Authors:    Marcin Kuszczak, www.zapytajmnie.com (author's christian site) 
     8 
     9    Version:    0.9.1 
     10    Date:       30-Apr-2008 
     11 
     12    History:    0.9.1 (30-Apr-2008) -   initial public version 
     13 
     14 ******************************************************************************/ 
    115 
    216module doost.database.SqlSelect; 
     
    1024import doost.database.Visitor; 
    1125 
    12 SqlSelect Select(COLS...)(COLS cols) { 
     26//------------------------------------------------------------------------------ 
     27 
     28/******************************************************************************* 
     29 ******************************************************************************/ 
     30public SqlSelect Select(COLS...)(COLS cols) { 
    1331    auto result = new SqlSelect; 
    1432    foreach(c; cols) { 
     
    1836} 
    1937 
    20 class SqlSelect : Sql { 
    21     private Column[] m_columns; 
    22  
    23     void accept(Visitor visitor) { 
     38public class SqlSelect : Sql { 
     39    public override void accept(Visitor visitor) { 
     40        visitor.visit(this); 
    2441    } 
    2542 
    26     void addColumn(Column c) { 
    27         m_columns~=c; 
    28     } 
    29  
    30     SqlSelect Where(Expression b) { 
     43    public SqlSelect Where(Expression b) { 
    3144        return this; 
    3245    } 
    3346 
    34     SqlSelect From(Table table) { 
     47    public SqlSelect From(Table table) { 
    3548        return this; 
    3649    } 
     50 
     51    private void addColumn(Column c) { 
     52        columns ~= c; 
     53    } 
     54 
     55    package Column[] columns; 
    3756} 
  • trunk/doost/database/Table.d

    r38 r39  
     1/******************************************************************************* 
     2 
     3    License:    Boost Software License, v. 1.0 
     4                Academic Free License, v. 3.0 
     5                BSD License 
     6 
     7    Authors:    Marcin Kuszczak, www.zapytajmnie.com (author's christian site) 
     8 
     9    Version:    0.9.1 
     10    Date:       30-Apr-2008 
     11 
     12    History:    0.9.1 (30-Apr-2008) -   initial public version 
     13 
     14 ******************************************************************************/ 
    115 
    216module doost.database.Table; 
     
    620import doost.database.Visitor; 
    721 
    8 class Table { 
     22/******************************************************************************* 
     23 ******************************************************************************/ 
     24public class Table { 
    925public: 
    10     void accept(Visitor visitor) { 
    11         visitor.tableInfo(name); 
    12  
    13         foreach(c; m_columns) { 
    14             (*c).accept(visitor); 
    15         } 
    16     } 
    17  
    18 protected: 
    19     Column*[] m_columns; 
     26    Column*[] pcolumns; 
    2027    string name; 
    2128} 
  • trunk/doost/database/Visitor.d

    r38 r39  
     1/******************************************************************************* 
     2 
     3    License:    Boost Software License, v. 1.0 
     4                Academic Free License, v. 3.0 
     5                BSD License 
     6 
     7    Authors:    Marcin Kuszczak, www.zapytajmnie.com (author's christian site) 
     8 
     9    Version:    0.9.1 
     10    Date:       30-Apr-2008 
     11 
     12    History:    0.9.1 (30-Apr-2008) -   initial public version 
     13 
     14 ******************************************************************************/ 
    115 
    216module doost.database.Visitor; 
    317 
    4 import doost.api.Common; 
    5 import doost.database.Table; 
    6 import doost.database.Column; 
     18import doost.database.Sql; 
    719import doost.database.SqlCreate; 
     20import doost.database.SqlInsert; 
    821import doost.database.SqlSelect; 
    922 
     23/******************************************************************************* 
     24 ******************************************************************************/ 
    1025interface Visitor { 
    11     void visit(SqlCreate); 
    12     void visit(SqlSelect); 
    13      
    14     void tableInfo(string); 
    15     void columnInfo(string, string); 
     26    public void visit(SqlCreate); 
     27    public void visit(SqlInsert); 
     28    public void visit(SqlSelect); 
    1629} 
  • trunk/doost/storage/FileStorage.d

    r38 r39  
    77    Authors:    Marcin Kuszczak, www.zapytajmnie.com (author's christian site) 
    88 
    9     Version:    0.9.0 
    10     Date:       18 Jan 2008 
     9    Version:    0.9.1 
     10    Date:       30-Apr-2008 
    1111 
    12     History:    0.9.0  -   initial public beta version 
     12    History:    0.9.1 (30-Apr-2008)    -   initial public version 
    1313 
    1414 ******************************************************************************/ 
     
    2424//------------------------------------------------------------------------------ 
    2525 
     26/******************************************************************************* 
     27 ******************************************************************************/ 
    2628class FileStorage(ELEMENTTYPE) : Storage!(ELEMENTTYPE) { 
    2729    alias ELEMENTTYPE[] STORAGETYPE; 
  • trunk/doost/storage/Storage.d

    r38 r39  
    77    Authors:    Marcin Kuszczak, www.zapytajmnie.com (author's christian site) 
    88 
    9     Version:    0.9.0 
    10     Date:       18 Jan 2008 
    11  
    12     History:    0.9.0  -   initial public beta version 
     9    Version:    0.9.1 
     10    Date:       30-Apr-2008 
     11 
     12    History:    0.9.1 (30-Apr-2008)    -   initial public version 
    1313 
    1414 ******************************************************************************/ 
     
    120120} 
    121121 
     122/******************************************************************************* 
     123 ******************************************************************************/ 
    122124T peek(T)(T array, uint pos, uint rep) { 
    123125    static assert(isArray!(T), onlyArrays); 
     
    128130//------------------------------------------------------------------------------ 
    129131 
     132/******************************************************************************* 
     133 ******************************************************************************/ 
    130134interface Storage(ELEMENTTYPE) { 
    131135    alias ELEMENTTYPE[] STORAGETYPE; 
  • trunk/doost/text/Escaper.d

    r38 r39  
    77    Authors:    Marcin Kuszczak, www.zapytajmnie.com (author's christian site) 
    88 
    9     Version:    0.9.0 
    10     Date:       18 Jan 2008 
    11  
    12     History:    0.9.0  -   initial public beta version 
     9    Version:    0.9.1 
     10    Date:       30-Apr-2008 
     11 
     12    History:    0.9.1 (30-Apr-2008)    -   initial public version 
    1313 
    1414 ******************************************************************************/ 
  • trunk/doost/text/Scanner.d

    r38 r39  
    77    Authors:    Marcin Kuszczak, www.zapytajmnie.com (author's christian site) 
    88 
    9     Version:    0.9.0 
    10     Date:       18 Jan 2008 
    11  
    12     History:    0.9.0  -   initial public beta version 
     9    Version:    0.9.1 
     10    Date:       30-Apr-2008 
     11 
     12    History:    0.9.1 (30-Apr-2008)    -   initial public version 
    1313 
    1414 ******************************************************************************/ 
     
    530530//------------------------------------------------------------------------------ 
    531531//TODO: named indexes for SequenceSet and CharSet? e.g. squarebracket, sharpbracket, bracket 
     532/******************************************************************************* 
     533 ******************************************************************************/ 
    532534struct SequenceSet(Array) { 
    533535    static const SequenceSet!(Array) 
  • trunk/doost/util/DUnit.d

    r38 r39  
    77    Authors:    Marcin Kuszczak, www.zapytajmnie.com (author's christian site) 
    88 
    9     Version:    0.9.0 
    10     Date:       18 Jan 2008 
    11  
    12     History:    0.9.0  -   initial public beta version 
     9    Version:    0.9.1 
     10    Date:       30-Apr-2008 
     11 
     12    History:    0.9.0 (08-Oct-2007)    -   initial public version 
    1313 
    1414 ******************************************************************************/ 
     
    138138//------------------------------------------------------------------------------ 
    139139 
    140 alias Element[] Row; 
    141  
    142140//TODO: struktura Row, i opAssign(Element[] val); w czasie przypisania sÄ 
    143141 
     
    175173    } 
    176174 
    177     void render(T...)(Row r, T param) { 
     175    void render(T...)(Element[] r, T param) { 
    178176        uint scount; // number of separators 
    179177        uint ccount; // number of cells 
     
    617615 
    618616    Renderer renderer; 
    619     Row title, tc, tc_tim, simple, etime, stat, fail, hl, empty; 
     617    Element[] title, tc, tc_tim, simple, etime, stat, fail, hl, empty; 
    620618 
    621619    void delegate() m_setup; 
  • trunk/doost/util/config/CommandLineStorage.d

    r28 r39  
    99                library named 'program_options' and created by Vladimir Prus. 
    1010 
    11     Version:    0.9.0 
    12     Date:       08 Oct 2007 
    13  
    14     History:    0.9.0  -   initial public beta version 
     11    Version:    0.9.1 
     12    Date:       30-Apr-2008 
     13 
     14    History:    0.9.0 (08-Oct-2007)    -   initial public version 
    1515 
    1616 ******************************************************************************/ 
  • trunk/doost/util/config/ConfigFileStorage.d

    r38 r39  
    99                library named 'program_options' and created by Vladimir Prus. 
    1010 
    11     Version:    0.9.0 
    12     Date:       08 Oct 2007 
    13  
    14     History:    0.9.0  -   initial public beta version 
     11    Version:    0.9.1 
     12    Date:       30-Apr-2008 
     13 
     14    History:    0.9.0 (08-Oct-2007)    -   initial public version 
    1515 
    1616 ******************************************************************************/ 
  • trunk/doost/util/config/DbStorage.d

    r20 r39  
    99                library named 'program_options' and created by Vladimir Prus. 
    1010 
    11     Version:    0.9.0 
    12     Date:       08 Oct 2007 
     11    Version:    0.9.1 
     12    Date:       30-Apr-2008 
    1313 
    14     History:    0.9.0  -   initial public beta version 
     14    History:    0.9.0 (08-Oct-2007)    -   initial public version 
    1515 
    1616 ******************************************************************************/ 
  • trunk/doost/util/config/EnvironmentStorage.d

    r24 r39  
    99                library named 'program_options' and created by Vladimir Prus. 
    1010 
    11     Version:    0.9.0 
    12     Date:       08 Oct 2007 
     11    Version:    0.9.1 
     12    Date:       30-Apr-2008 
    1313 
    14     History:    0.9.0  -   initial public beta version 
     14    History:    0.9.0 (08-Oct-2007)    -   initial public version 
    1515 
    1616 ******************************************************************************/ 
  • trunk/doost/util/config/Exception.d

    r20 r39  
    99                library named 'program_options' and created by Vladimir Prus. 
    1010 
    11     Version:    0.9.0 
    12     Date:       08 Oct 2007 
     11    Version:    0.9.1 
     12    Date:       30-Apr-2008 
    1313 
    14     History:    0.9.0  -   initial public beta version 
     14    History:    0.9.0 (08-Oct-2007)    -   initial public version 
    1515 
    1616 ******************************************************************************/ 
  • trunk/doost/util/config/Formatter.d

    r20 r39  
    99                library named 'program_options' and created by Vladimir Prus. 
    1010 
    11     Version:    0.9.0 
    12     Date:       08 Oct 2007 
    13  
    14     History:    0.9.0  -   initial public beta version 
     11    Version:    0.9.1 
     12    Date:       30-Apr-2008 
     13 
     14    History:    0.9.0 (08-Oct-2007)    -   initial public version 
    1515 
    1616 ******************************************************************************/ 
  • trunk/doost/util/config/Option.d

    r28 r39  
    99                library named 'program_options' and created by Vladimir Prus. 
    1010 
    11     Version:    0.9.0 
    12     Date:       08 Oct 2007 
    13  
    14     History:    0.9.0  -   initial public beta version 
     11    Version:    0.9.1 
     12    Date:       30-Apr-2008 
     13 
     14    History:    0.9.0 (08-Oct-2007)    -   initial public version 
    1515 
    1616 ******************************************************************************/ 
  • trunk/doost/util/config/PoTextArchive.d

    r38 r39  
    99                library named 'program_options' and created by Vladimir Prus. 
    1010 
    11     Version:    0.9.0 
    12     Date:       08 Oct 2007 
     11    Version:    0.9.1 
     12    Date:       30-Apr-2008 
    1313 
    14     History:    0.9.0  -   initial public beta version 
     14    History:    0.9.0 (08-Oct-2007)    -   initial public version 
    1515 
    1616 ******************************************************************************/ 
  • trunk/doost/util/config/ProgramOptions.d

    r38 r39  
    99                library named 'program_options' and created by Vladimir Prus. 
    1010 
    11     Version:    0.9.0 
    12     Date:       08 Oct 2007 
    13  
    14     History:    0.9.0  -   initial public beta version 
     11    Version:    0.9.1 
     12    Date:       30-Apr-2008 
     13 
     14    History:    0.9.0 (08-Oct-2007)    -   initial public version 
    1515 
    1616 ******************************************************************************/ 
  • trunk/doost/util/config/Utils.d

    r38 r39  
    99                library named 'program_options' and created by Vladimir Prus. 
    1010 
    11     Version:    0.9.0 
    12     Date:       08 Oct 2007 
     11    Version:    0.9.1 
     12    Date:       30-Apr-2008 
    1313 
    14     History:    0.9.0  -   initial public beta version 
     14    History:    0.9.0 (08-Oct-2007)    -   initial public version 
    1515 
    1616 ******************************************************************************/ 
  • trunk/doost/util/config/Value.d

    r38 r39  
    99                library named 'program_options' and created by Vladimir Prus. 
    1010 
    11     Version:    0.9.0 
    12     Date:       08 Oct 2007 
    13  
    14     History:    0.9.0  -   initial public beta version 
     11    Version:    0.9.1 
     12    Date:       30-Apr-2008 
     13 
     14    History:    0.9.0 (08-Oct-2007)    -   initial public version 
    1515 
    1616 ******************************************************************************/ 
  • trunk/doost/util/config/Version.d

    r22 r39  
    99                library named 'program_options' and created by Vladimir Prus. 
    1010 
    11     Version:    0.9.0 
    12     Date:       08 Oct 2007 
     11    Version:    0.9.1 
     12    Date:       30-Apr-2008 
    1313 
    14     History:    0.9.0  -   initial public beta version 
     14    History:    0.9.0 (08-Oct-2007)    -   initial public version 
    1515 
    1616 ******************************************************************************/ 
  • trunk/doost/util/serializer/Registry.d

    r38 r39  
    77    Authors:    Marcin Kuszczak, www.zapytajmnie.com (author's christian site) 
    88 
    9     Version:    0.9.0 
    10     Date:       18 Jan 2008 
    11  
    12     History:    0.9.0  -   initial public beta version 
     9    Version:    0.9.1 
     10    Date:       30-Apr-2008 
     11 
     12    History:    0.9.1 (30-Apr-2008)    -   initial public version 
    1313 
    1414 ******************************************************************************/ 
  • trunk/doost/util/serializer/Serializer.d

    r38 r39  
    77    Authors:    Marcin Kuszczak, www.zapytajmnie.com (author's christian site) 
    88 
    9     Version:    0.9.0 
    10     Date:       18 Jan 2008 
    11  
    12     History:    0.9.0  -   initial public beta version 
     9    Version:    0.9.1 
     10    Date:       30-Apr-2008 
     11 
     12    History:    0.9.1 (30-Apr-2008)    -   initial public version 
    1313 
    1414 ******************************************************************************/ 
     
    5454        Below templates are hacks for use with static arrays 
    5555 ******************************************************************************/ 
    56 private template normalizedType(T : U[N], U, size_t N) { 
    57     alias U[] normalizedType; 
    58 } 
    59  
    60 private template normalizedType(T) { 
    61     alias T normalizedType; 
    62 } 
    63  
    6456private void checkType(T : U[N], U, size_t N)(U[] arr) { 
    6557    if (arr.length>N) 
     
    8072//ENH: lack of static access to some member of templates without instantiation needed 
    8173//BUG: inner class Archive is invisible in default parameter of template 
     74/******************************************************************************* 
     75 ******************************************************************************/ 
    8276class Serializer(alias CONCRETEARCHIVE, STORAGE=string) { 
    8377//ENH: when parameter of function is preceeding by alias, stringof on this parameter 
  • trunk/doost/util/serializer/archive/JsonArchive.d

    r38 r39  
    77    Authors:    Marcin Kuszczak, www.zapytajmnie.com (author's christian site) 
    88 
    9     Version:    0.9.0 
    10     Date:       18 Jan 2008 
    11  
    12     History:    0.9.0  -   initial public beta version 
     9    Version:    0.9.1 
     10    Date:       30-Apr-2008 
     11 
     12    History:    0.9.1 (30-Apr-2008)    -   initial public version 
    1313 
    1414 ******************************************************************************/ 
  • trunk/doost/util/serializer/archive/TextArchive.d

    r38 r39  
    77    Authors:    Marcin Kuszczak, www.zapytajmnie.com (author's christian site) 
    88 
    9     Version:    0.9.0 
    10     Date:       18 Jan 2008 
    11  
    12     History:    0.9.0  -   initial public beta version 
     9    Version:    0.9.1 
     10    Date:       30-Apr-2008 
     11 
     12    History:    0.9.1 (30-Apr-2008)    -   initial public version 
    1313 
    1414 ******************************************************************************/ 
  • trunk/examples/core/FunctionTest.d

    r38 r39  
    77    Authors:    Marcin Kuszczak, www.zapytajmnie.com (author's christian site) 
    88 
    9     Version:    0.9.0 
    10     Date:       08 Oct 2007 
     9    Version:    0.9.1 
     10    Date:       30-Apr-2008 
    1111 
    12     History:    0.9.0  -   initial public beta version 
     12    History:    0.9.0 (08-Oct-2007)    -   initial public version 
    1313 
    1414 ******************************************************************************/ 
  • trunk/examples/database/PackageTest.d

    r38 r39  
    77    Authors:    Marcin Kuszczak, www.zapytajmnie.com (author's christian site) 
    88 
    9     Version:    0.9.0 
    10     Date:       18 Jan 2008 
     9    Version:    0.9.1 
     10    Date:       30-Apr-2008 
    1111 
    12     History:    0.9.0  -   initial public beta version 
     12    History:    0.9.1 (30-Apr-2008)    -   initial public version 
    1313 
    1414 ******************************************************************************/ 
     
    1616import std.stdio; 
    1717 
    18 import dbi.Database; 
    1918import dbi.sqlite.SqliteDatabase; 
    2019 
    2120import doost.database.Sql; 
    22 import doost.database.SqlSelect; 
    23 import doost.database.SqlCreate; 
    2421import doost.database.Recordset; 
    25 import doost.database.DbiAdapter; 
     22import doost.database.Expression; 
     23import doost.database.visitors.SqliteDb; 
    2624 
    2725import examples.database.TestSchema; 
     
    3331    Sql sql; 
    3432    sql = Select(BOOK.AUTHOR, BOOK.TITLE); 
    35     sql = Select(BOOK.AUTHOR).Where(BOOK.AUTHOR == "Szklarski"); 
     33    sql = Select(BOOK.AUTHOR).Where(leq(BOOK.AUTHOR, "Szklarski")); 
     34    sql = Select(BOOK.AUTHOR).Where(land(leq(BOOK.AUTHOR, "Szklarski"), leq(BOOK.TITLE, "Tomek w krainie kangurów"))); 
    3635 
    3736    with(BOOK) { 
    38         sql = Select(AUTHOR, TITLE).From(BOOK).Where(AUTHOR == "Szklarski"); 
     37        sql = Select(AUTHOR, TITLE).From(BOOK).Where(leq(AUTHOR, "Szklarski")); 
    3938    } 
    4039 
    4140    sql = Select(BOOK.AUTHOR, BOOK.TITLE, BORROW_RECORD.PERSON, BORROW_RECORD.BORROWED); 
    4241 
    43     auto r = new Recordset; 
    4442 
    45     writefln(typeof(r.column(BOOK.AUTHOR).row(0u)).stringof); 
    46     writefln(typeof(r.column(BOOK.ID).row(0u)).stringof); 
    47  
    48     writefln(typeof(r.row(5).column(BOOK.ID)).stringof); 
    49  
    50     writefln("By index: ", BOOK.tupleof.length, "  ", typeof(r.row(5).column(BOOK.tupleof[2])).stringof); 
    51  
    52     writefln(r.column(BOOK.ID).asString(0u)); 
    5343 
    5444    foreach(val; BOOK.tupleof) { 
     
    5747 
    5848    writefln(BOOK.ID); 
    59     writefln((BOOK.AUTHOR == "Szklarski").test); 
    60     writefln((BOOK.AUTHOR == "Szklarski").test); 
     49    writefln(leq(BOOK.AUTHOR, "Szklarski")); 
    6150 
    62     sql = Create(BOOK); 
    63     DbiAdapter adapter = new DbiAdapter(new SqliteDatabase("database.sqlite")); 
    64     adapter.execute(sql); 
     51    //TODO: visitor moÅŒe przyjmować w this() bazę danych, tak ÅŒe od razu będzie 
     52    //generował i wykonywał polecenia; dzięki temu moÅŒna łatwo zasymulować 
     53    //e.g. IF NOT EXISTS dla create table 
     54    //takÅŒe moÅŒna zrobić prepared statement albo mapować konkretne typy na 
     55    //pytajniki 
     56    //tylko jak wtedy wymieniać bazy??? 
     57    //visitor ewentualnie moÅŒe zwracać informacje, ÅŒe niektóre operacje sÄ 
     58 unsupported 
     59 
     60    auto db = new SqliteDb("database.sqlite"); 
     61 
     62    sql = Create(BOOK).IfNotExists; 
     63    db.execute(sql); 
     64 
     65    sql = Create(BORROW_RECORD).IfNotExists; 
     66    db.execute(sql); 
     67 
     68    sql = Insert(BOOK.ID, 56)(BOOK.AUTHOR, "Alfred Szklarski")(BOOK.TITLE, "Tomek wsrod kangurow"); 
     69    db.execute(sql); 
     70 
     71    sql = Select(BOOK.ID, BOOK.AUTHOR, BOOK.TITLE); 
     72    auto r = db.query(sql); 
     73 
     74    for(uint i=0; i<r.length; i++) { 
     75        writef(i); 
     76        writef(" - "); 
     77        writef(r.column(BOOK.ID).row(i)); 
     78        writef(" - "); 
     79        writef(r.column(BOOK.AUTHOR).row(i)); 
     80        writef(" - "); 
     81        writef(r.column(BOOK.TITLE).row(i)); 
     82        writefln; 
     83    } 
     84 
     85    writefln(typeof(r.column(BOOK.AUTHOR).row(0u)).stringof); 
     86    writefln(typeof(r.column(BOOK.ID).row(0u)).stringof); 
     87 
     88    writefln("By index: ", BOOK.tupleof.length, "  ", typeof(r.column(BOOK.tupleof[2]).row(5)).stringof); 
     89 
     90    writefln(r.column(BOOK.ID).asString(0u)); 
     91 
    6592} 
  • trunk/examples/database/TestSchema.d

    r38 r39  
     1/******************************************************************************* 
     2 
     3    License:    Boost Software License, v. 1.0 
     4                Academic Free License, v. 3.0 
     5                BSD License 
     6 
     7    Authors:    Marcin Kuszczak, www.zapytajmnie.com (author's christian site) 
     8 
     9    Version:    0.9.1 
     10    Date:       30-Apr-2008 
     11 
     12    History:    0.9.1 (30-Apr-2008) -   initial public version 
     13 
     14 ******************************************************************************/ 
    115 
    216module examples.database.TestSchema; 
     
    519import doost.database.Schema; 
    620 
    7 const string val = schema(import("TestSchema.schema")); 
     21const string sch = import("TestSchema.schema"); 
     22 
     23const string val = schema(sch); 
    824pragma(msg, val); 
    925mixin(val); 
  • trunk/examples/database/database.cbp

    r38 r39  
    1414                <Option compiler="dmd" /> 
    1515                <Compiler> 
     16                    <Add option="-g" /> 
     17                    <Add option="-debug" /> 
    1618                    <Add option="-J." /> 
    1719                </Compiler> 
     
    2628        </VirtualTargets> 
    2729        <Compiler> 
    28             <Add option="-unittest" /> 
    2930            <Add option="-quiet" /> 
    3031            <Add option="-g" /> 
    3132            <Add option="-debug" /> 
    32             <Add option="-Dd$(#doost)/doc/database/ddoc/ -version=Phobos" /> 
    3333            <Add option="-J$(#doost)/examples/database/" /> 
    3434            <Add option="-version=ddbi_v62" /> 
     35            <Add option="-version=Tango" /> 
    3536            <Add directory="$(#doost)" /> 
    3637            <Add directory="$(#std2)" /> 
     
    4445            <Add directory="C:\DLang\bin" /> 
    4546        </Linker> 
     47        <Unit filename="..\..\..\..\..\DLang\src\ddbi\dbi\DBIException.d" /> 
     48        <Unit filename="..\..\..\..\..\DLang\src\ddbi\dbi\Database.d" /> 
     49        <Unit filename="..\..\..\..\..\DLang\src\ddbi\dbi\ErrorCode.d" /> 
     50        <Unit filename="..\..\..\..\..\DLang\src\ddbi\dbi\Result.d" /> 
     51        <Unit filename="..\..\..\..\..\DLang\src\ddbi\dbi\Row.d" /> 
     52        <Unit filename="..\..\..\..\..\DLang\src\ddbi\dbi\Statement.d" /> 
     53        <Unit filename="..\..\..\..\..\DLang\src\ddbi\dbi\sqlite\SqliteDatabase.d" /> 
     54        <Unit filename="..\..\..\..\..\DLang\src\ddbi\dbi\sqlite\SqliteError.d" /> 
     55        <Unit filename="..\..\..\..\..\DLang\src\ddbi\dbi\sqlite\SqliteResult.d" /> 
     56        <Unit filename="..\..\..\..\..\DLang\src\ddbi\dbi\sqlite\imp.d" /> 
     57        <Unit filename="..\..\..\..\..\DLang\src\std2\std2\conv.d" /> 
     58        <Unit filename="..\..\doost\core\Any.d" /> 
     59        <Unit filename="..\..\doost\core\Traits.d" /> 
    4660        <Unit filename="..\..\doost\database\Column.d" /> 
    47         <Unit filename="..\..\doost\database\DbiAdapter.d" /> 
     61        <Unit filename="..\..\doost\database\DbVisitor.d" /> 
     62        <Unit filename="..\..\doost\database\Element.d" /> 
    4863        <Unit filename="..\..\doost\database\Expression.d" /> 
    4964        <Unit filename="..\..\doost\database\Recordset.d" /> 
     
    5166        <Unit filename="..\..\doost\database\Sql.d" /> 
    5267        <Unit filename="..\..\doost\database\SqlCreate.d" /> 
     68        <Unit filename="..\..\doost\database\SqlInsert.d" /> 
    5369        <Unit filename="..\..\doost\database\SqlSelect.d" /> 
    5470        <Unit filename="..\..\doost\database\Table.d" /> 
    5571        <Unit filename="..\..\doost\database\Visitor.d" /> 
     72        <Unit filename="..\..\doost\database\visitors\SqliteDb.d" /> 
    5673        <Unit filename="..\..\doost\storage\Storage.d" /> 
    5774        <Unit filename="..\..\doost\text\Scanner.d" /> 
  • trunk/examples/storage/PackageTest.d

    r38 r39  
    77    Authors:    Marcin Kuszczak, www.zapytajmnie.com (author's christian site) 
    88 
    9     Version:    0.9.0 
    10     Date:       18 Jan 2008 
     9    Version:    0.9.1 
     10    Date:       30-Apr-2008 
    1111 
    12     History:    0.9.0  -   initial public beta version 
     12    History:    0.9.1 (30-Apr-2008)    -   initial public version 
    1313 
    1414 ******************************************************************************/ 
  • trunk/examples/sys/FunctionTest.d

    r20 r39  
    77    Authors:    Marcin Kuszczak, www.zapytajmnie.com (author's christian site) 
    88 
    9     Version:    0.9.0 
    10     Date:       08 Oct 2007 
     9    Version:    0.9.1 
     10    Date:       30-Apr-2008 
    1111 
    12     History:    0.9.0  -   initial public beta version 
     12    History:    0.9.0 (08-Oct-2007)    -   initial public version 
    1313 
    1414 ******************************************************************************/ 
  • trunk/examples/text/PackageTest.d

    r37 r39  
    77    Authors:    Marcin Kuszczak, www.zapytajmnie.com (author's christian site) 
    88 
    9     Version:    0.9.0 
    10     Date:       18 Jan 2008 
     9    Version:    0.9.1 
     10    Date:       30-Apr-2008 
    1111 
    12     History:    0.9.0  -   initial public beta version 
     12    History:    0.9.1 (30-Apr-2008)    -   initial public version 
    1313 
    1414 ******************************************************************************/ 
  • trunk/examples/util/config/CustomSyntax.d

    r20 r39  
    99                library named 'program_options' and created by Vladimir Prus. 
    1010 
    11     Version:    0.9.0 
    12     Date:       08 Oct 2007 
     11    Version:    0.9.1 
     12    Date:       30-Apr-2008 
    1313 
    14     History:    0.9.0  -   initial public beta version 
     14    History:    0.9.0 (08-Oct-2007)    -   initial public version 
    1515 
    1616    Description: 
  • trunk/examples/util/config/First.d

    r20 r39  
    99                library named 'program_options' and created by Vladimir Prus. 
    1010 
    11     Version:    0.9.0 
    12     Date:       08 Oct 2007 
     11    Version:    0.9.1 
     12    Date:       30-Apr-2008 
    1313 
    14     History:    0.9.0  -   initial public beta version 
     14    History:    0.9.0 (08-Oct-2007)    -   initial public version 
    1515 
    1616    Description: 
  • trunk/examples/util/config/FunctionTest.d

    r38 r39  
    99                library named 'program_options' and created by Vladimir Prus. 
    1010 
    11     Version:    0.9.0 
    12     Date:       08 Oct 2007 
    13  
    14     History:    0.9.0  -   initial public beta version 
     11    Version:    0.9.1 
     12    Date:       30-Apr-2008 
     13 
     14    History:    0.9.0 (08-Oct-2007)    -   initial public version 
    1515 
    1616    Description: 
  • trunk/examples/util/config/MultipleSources.d

    r20 r39  
    99                library named 'program_options' and created by Vladimir Prus. 
    1010 
    11     Version:    0.9.0 
    12     Date:       08 Oct 2007 
     11    Version:    0.9.1 
     12    Date:       30-Apr-2008 
    1313 
    14     History:    0.9.0  -   initial public beta version 
     14    History:    0.9.0 (08-Oct-2007)    -   initial public version 
    1515 
    1616    Description: 
  • trunk/examples/util/config/OptionGroups.d

    r20 r39  
    99                library named 'program_options' and created by Vladimir Prus. 
    1010 
    11     Version:    0.9.0 
    12     Date:       08 Oct 2007 
     11    Version:    0.9.1 
     12    Date:       30-Apr-2008 
    1313 
    14     History:    0.9.0  -   initial public beta version 
     14    History:    0.9.0 (08-Oct-2007)    -   initial public version 
    1515 
    1616    Description: 
  • trunk/examples/util/config/OptionsDescription.d

    r20 r39  
    99                library named 'program_options' and created by Vladimir Prus. 
    1010 
    11     Version:    0.9.0 
    12     Date:       08 Oct 2007 
     11    Version:    0.9.1 
     12    Date:       30-Apr-2008 
    1313 
    14     History:    0.9.0  -   initial public beta version 
     14    History:    0.9.0 (08-Oct-2007)    -   initial public version 
    1515 
    1616    Description: 
  • trunk/examples/util/config/Real.d

    r20 r39  
    99                library named 'program_options' and created by Vladimir Prus. 
    1010 
    11     Version:    0.9.0 
    12     Date:       08 Oct 2007 
     11    Version:    0.9.1 
     12    Date:       30-Apr-2008 
    1313 
    14     History:    0.9.0  -   initial public beta version 
     14    History:    0.9.0 (08-Oct-2007)    -   initial public version 
    1515 
    1616    Description: 
  • trunk/examples/util/config/RegEx.d

    r28 r39  
    99                library named 'program_options' and created by Vladimir Prus. 
    1010 
    11     Version:    0.9.0 
    12     Date:       08 Oct 2007 
     11    Version:    0.9.1 
     12    Date:       30-Apr-2008 
    1313 
    14     History:    0.9.0  -   initial public beta version 
     14    History:    0.9.0 (08-Oct-2007)    -   initial public version 
    1515 
    1616    Description: 
  • trunk/examples/util/config/ResponseFile.d

    r20 r39  
    99                library named 'program_options' and created by Vladimir Prus. 
    1010 
    11     Version:    0.9.0 
    12     Date:       08 Oct 2007 
     11    Version:    0.9.1 
     12    Date:       30-Apr-2008 
    1313 
    14     History:    0.9.0  -   initial public beta version 
     14    History:    0.9.0 (08-Oct-2007)    -   initial public version 
    1515 
    1616    Description: 
  • trunk/examples/util/serializer/FunctionTest.d

    r38 r39  
    77    Authors:    Marcin Kuszczak, www.zapytajmnie.com (author's christian site) 
    88 
    9     Version:    0.9.0 
    10     Date:       18 Jan 2008 
    11  
    12     History:    0.9.0  -   initial public beta version 
     9    Version:    0.9.1 
     10    Date:       30-Apr-2008 
     11 
     12    History:    0.9.1 (30-Apr-2008)    -   initial public version 
    1313 
    1414 ******************************************************************************/ 
  • trunk/examples/util/serializer/FunctionTest1.d

    r38 r39  
    77    Authors:    Marcin Kuszczak, www.zapytajmnie.com (author's christian site) 
    88 
    9     Version:    0.9.0 
    10     Date:       18 Jan 2008 
    11  
    12     History:    0.9.0  -   initial public beta version 
     9    Version:    0.9.1 
     10    Date:       30-Apr-2008 
     11 
     12    History:    0.9.1 (30-Apr-2008)    -   initial public version 
    1313 
    1414 ******************************************************************************/