~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/serialize/schema_reader.cc

  • Committer: Mark Atwood
  • Date: 2009-01-05 04:37:22 UTC
  • mto: (758.1.1 devel)
  • mto: This revision was merged to the branch mainline in revision 759.
  • Revision ID: me@mark.atwood.name-20090105043722-03l4mzcxi4yjjjih
replace sql_print_error etc with errmsg_print

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/serialize/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
void printSchema(const drizzle::Schema *schema)
12
12
{
13
13
  cout << "CREATE SCHEMA `" << schema->name() << "` ";
14
14
  if (schema->has_collation())
18
18
  cout << ";" << endl;
19
19
}
20
20
 
21
 
int main(int argc, char* argv[]) 
 
21
int main(int argc, char* argv[])
22
22
{
23
23
  GOOGLE_PROTOBUF_VERIFY_VERSION;
24
24
 
32
32
  {
33
33
    // Read the existing address book.
34
34
    fstream input(argv[1], ios::in | ios::binary);
35
 
    if (!schema.ParseFromIstream(&input)) 
 
35
    if (!schema.ParseFromIstream(&input))
36
36
    {
37
37
      cerr << "Failed to parse schema." << endl;
38
38
      return -1;