proj home

Files   Classes   Functions   Hierarchy  

cubepermanent Class Reference

Primitive save/restore by writing the current state to a file cube.txt . More...

#include <cubepermanent.h>

Collaboration diagram for cubepermanent:

List of all members.

Public Member Functions

 cubepermanent (cube &cb_)
 By default the cubes state is loaded.
void load ()
 Load the saved state.
void save () const
 Save the current cube state.


Detailed Description

Primitive save/restore by writing the current state to a file cube.txt .

Definition at line 10 of file cubepermanent.h.


Constructor & Destructor Documentation

cubepermanent::cubepermanent ( cube cb_  ) 

By default the cubes state is loaded.

Definition at line 6 of file cubepermanent.cpp.

References load().

00007   : cb(cb_)
00008 {
00009   load();
00010 }


Member Function Documentation

void cubepermanent::load (  ) 

Load the saved state.

Definition at line 12 of file cubepermanent.cpp.

References cube::read().

Referenced by cubepermanent().

00013 {
00014   ifstream file("cube.txt");
00015 
00016   if (!file)
00017     return;
00018 
00019   cb.read(file);
00020 }

void cubepermanent::save (  )  const

Save the current cube state.

Definition at line 22 of file cubepermanent.cpp.

Referenced by cubegui::keyboard01().

00023 {
00024   ofstream file("cube.txt");
00025    
00026   if (!file)
00027     return;
00028 
00029   file << cb;
00030 }


The documentation for this class was generated from the following files:

Generated on Fri Mar 4 00:49:52 2011 for Chelton Evans Source by  doxygen 1.5.8