/*
 * X10 controller plugin for the Video Disk Recorder       
 *
 * See the README file for copyright information and how to reach the author.
 *
 * $Id: X10Device.c,v 1.7 2005/03/17 13:06:34 toni Exp $                                           
 */

#include <string>
#include <iostream>
#include "i18n.h"
#include "X10Device.h"

cX10Device::cX10Device() {
  name=NULL;
  xid=NULL;
}

cX10Device::~cX10Device() {
  free(name);
  free(xid);
}

char* cX10Device::getName() const {
  return name;
}

char* cX10Device::getXid() const {
  return xid;
}

bool cX10Device::Parse(const char* s) {
  name = strdup(s);
  char *p = strchr(name, ':');
  *p++ = 0;
  xid = strdup(p);
  return xid != NULL;
}

cX10Devices devices;

cX10Devices::cX10Devices(void) {
  name = NULL;
  xid = NULL;
}

cX10Devices::~cX10Devices() {
  free(name);
  free(xid);
}

