~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/message/schema_reader.cc

Merged in latest plugin-slot-reorg.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#include <iostream>
2
2
#include <fstream>
3
3
#include <string>
4
 
#include "schema.pb.h"
 
4
#include <drizzled/message/schema.pb.h>
5
5
using namespace std;
6
6
 
7
 
/* 
 
7
/*
8
8
  Written from Google proto example
9
9
*/
10
10
 
11
 
void printSchema(const drizzle::Schema *schema) 
 
11
static void printSchema(const drizzled::message::Schema *schema)
12
12
{
13
13
  cout << "CREATE SCHEMA `" << schema->name() << "` ";
14
14
  if (schema->has_collation())
15
15
    cout << "COLLATE `" << schema->collation() << "` ";
16
 
  if (schema->has_characterset())
17
 
    cout << "CHARACTER SET `" << schema->characterset() <<"` ";
18
16
  cout << ";" << endl;
19
17
}
20
18
 
21
 
int main(int argc, char* argv[]) 
 
19
int main(int argc, char* argv[])
22
20
{
23
21
  GOOGLE_PROTOBUF_VERIFY_VERSION;
24
22
 
27
25
    return -1;
28
26
  }
29
27
 
30
 
  drizzle::Schema schema;
 
28
  drizzled::message::Schema schema;
31
29
 
32
30
  {
33
31
    // Read the existing address book.
34
32
    fstream input(argv[1], ios::in | ios::binary);
35
 
    if (!schema.ParseFromIstream(&input)) 
 
33
    if (!schema.ParseFromIstream(&input))
36
34
    {
37
35
      cerr << "Failed to parse schema." << endl;
38
36
      return -1;