Log In | Get Help   
Home My Page Projects Code Snippets Project Openings Mareframe
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files
[mareframe] View of /trunk/gadget/readword.cc
[mareframe] / trunk / gadget / readword.cc Repository:
ViewVC logotype

View of /trunk/gadget/readword.cc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (download) (annotate)
Mon Feb 10 17:09:07 2014 UTC (10 years, 4 months ago) by agomez
File size: 2173 byte(s)
Initial version based on Gadget 2.2.00
#include "readword.h"
#include "errorhandler.h"
#include "gadget.h"
#include "global.h"

void readWordAndVariable(CommentStream& infile, const char* str, double& number) {
  char text[MaxStrLength];
  strncpy(text, "", MaxStrLength);
  infile >> text;
  if (strcasecmp(text, str) != 0)
    handle.logFileUnexpected(LOGFAIL, str, text);
  infile >> number >> ws;
}

void readWordAndVariable(CommentStream& infile, const char* str, int& number) {
  char text[MaxStrLength];
  strncpy(text, "", MaxStrLength);
  infile >> text;
  if (strcasecmp(text, str) != 0)
    handle.logFileUnexpected(LOGFAIL, str, text);
  infile >> number >> ws;
}

void readWordAndValue(CommentStream& infile, const char* str, char* value) {
  char text[MaxStrLength];
  strncpy(text, "", MaxStrLength);
  infile >> text;
  if (strcasecmp(text, str) != 0)
    handle.logFileUnexpected(LOGFAIL, str, text);
  infile >> value >> ws;
}

void readWordAndVariable(CommentStream& infile, const char* str, Formula& formula) {
  char text[MaxStrLength];
  strncpy(text, "", MaxStrLength);
  infile >> text;
  if (strcasecmp(text, str) != 0)
    handle.logFileUnexpected(LOGFAIL, str, text);
  infile >> formula >> ws;
}

void readWordAndModelVariable(CommentStream& infile, const char* str, ModelVariable& modelvariable,
  const TimeClass* const TimeInfo, Keeper* const keeper) {
  char text[MaxStrLength];
  strncpy(text, "", MaxStrLength);
  infile >> text;
  if (strcasecmp(text, str) != 0)
    handle.logFileUnexpected(LOGFAIL, str, text);
  modelvariable.read(infile, TimeInfo, keeper);
}

void readWordAndTwoVariables(CommentStream& infile, const char* str, double& number1, double& number2) {
  char text[MaxStrLength];
  strncpy(text, "", MaxStrLength);
  infile >> text;
  if (strcasecmp(text, str) != 0)
    handle.logFileUnexpected(LOGFAIL, str, text);
  infile >> number1 >> number2 >> ws;
}

void readWordAndTwoVariables(CommentStream& infile, const char* str, int& number1, int& number2) {
  char text[MaxStrLength];
  strncpy(text, "", MaxStrLength);
  infile >> text;
  if (strcasecmp(text, str) != 0)
    handle.logFileUnexpected(LOGFAIL, str, text);
  infile >> number1 >> number2 >> ws;
}

root@forge.cesga.es
ViewVC Help
Powered by ViewVC 1.0.0  

Powered By FusionForge