5 // Copyright (c) 2007-2008 Jiri Moudry, Pascal Craponne
\r
7 // Permission is hereby granted, free of charge, to any person obtaining a copy
\r
8 // of this software and associated documentation files (the "Software"), to deal
\r
9 // in the Software without restriction, including without limitation the rights
\r
10 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
\r
11 // copies of the Software, and to permit persons to whom the Software is
\r
12 // furnished to do so, subject to the following conditions:
\r
14 // The above copyright notice and this permission notice shall be included in
\r
15 // all copies or substantial portions of the Software.
\r
17 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
\r
18 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
\r
19 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
\r
20 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
\r
21 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
\r
22 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
\r
27 using System.Collections.Generic;
\r
29 using DbLinq.Schema.Dbml;
\r
30 using DbLinq.Vendor;
\r
32 namespace DbMetal.Generator
\r
37 interface IProcessor
\r
40 /// The SchemaLoadFactory is used to create the ISchemaLoader (who loads the schema from the database)
\r
41 /// Automatically created by IProcessor implementation
\r
43 ISchemaLoaderFactory SchemaLoaderFactory { get; set; }
\r
48 TextWriter Log { get; set; }
\r
51 /// Whole process, given application parameters
\r
53 /// <param name="args"></param>
\r
54 void Process(string[] args);
\r
56 /// Generates a code file, given parameters
\r
58 /// <param name="parameters">Application parameters</param>
\r
59 /// <param name="dbSchema">Loaded schema (from file or database)</param>
\r
60 /// <param name="schemaLoader">Schema loader related to dbSchema</param>
\r
61 /// <param name="filename">Output filename</param>
\r
62 void GenerateCode(Parameters parameters, Database dbSchema, ISchemaLoader schemaLoader, string filename);
\r
64 /// Loads a schema from a database
\r
66 /// <param name="parameters"></param>
\r
67 /// <param name="schemaLoader"></param>
\r
68 /// <returns></returns>
\r
69 Database ReadSchema(Parameters parameters, out ISchemaLoader schemaLoader);
\r
71 /// Loads a schema from a given file
\r
73 /// <param name="filename"></param>
\r
74 /// <param name="parameters"></param>
\r
75 /// <returns></returns>
\r
76 Database ReadSchema(Parameters parameters, string filename);
\r
78 /// Lists all code generators available in DbMetal
\r
80 /// <returns></returns>
\r
81 IEnumerable<ICodeGenerator> EnumerateCodeGenerators();
\r
83 /// Find a code generator given the /language or filename extension
\r
85 /// <param name="parameters"></param>
\r
86 /// <param name="filename"></param>
\r
87 /// <returns></returns>
\r
88 ICodeGenerator FindCodeGenerator(Parameters parameters, string filename);
\r