/* -*- c++ -*- FILE: Preferences.cpp RCS REVISION: $Revision: 1.7 $ COPYRIGHT: (c) 1999 -- 2003 Melinda Green, Don Hatch, and Jay Berkenbilt - Superliminal Software LICENSE: Free to use and modify for non-commercial purposes as long as the following conditions are adhered to: 1) Obvious credit for the source of this code and the designs it embodies are clearly made, and 2) Ports and derived versions of 4D Magic Cube programs are not distributed without the express written permission of the authors. DESCRIPTION: Implementation of Preferences class */ #include "Preferences.h" Preferences::Preferences() : length(3) { // nothing needed } bool Preferences::getBoolProperty(char* name, bool def) { return (getenv(name) ? true : def); } char* Preferences::getStringProperty(char* name, char* def) { return (getenv(name) ? getenv(name) : def); } int Preferences::getIntProperty(char* name, int def) { return (getenv(name) ? atoi(getenv(name)) : def); } real Preferences::getRealProperty(char* name, real def) { return (getenv(name) ? atof(getenv(name)) : def); } void Preferences::setLength(int length) { this->length = length; } int Preferences::getLength() { return this->length; } // Local Variables: // c-basic-offset: 4 // c-comment-only-line-offset: 0 // c-file-offsets: ((defun-block-intro . +) (block-open . 0) (substatement-open . 0) (statement-cont . +) (statement-case-open . +4) (arglist-intro . +) (arglist-close . +) (inline-open . 0)) // indent-tabs-mode: nil // End: