1/* 2 * Copyright 2004-2011 Haiku Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 */ 6 7#include <stdlib.h> 8 9#include "NetworkSetupProfile.h" 10 11 12NetworkSetupProfile::NetworkSetupProfile() 13 : 14 fRoot(new BEntry()), 15 fPath(new BPath()) 16{ 17} 18 19 20NetworkSetupProfile::NetworkSetupProfile(const char* path) 21{ 22 SetTo(path); 23} 24 25 26NetworkSetupProfile::NetworkSetupProfile(const entry_ref* ref) 27{ 28 SetTo(ref); 29} 30 31 32NetworkSetupProfile::NetworkSetupProfile(BEntry* entry) 33{ 34 SetTo(entry); 35} 36 37 38NetworkSetupProfile::~NetworkSetupProfile() 39{ 40 delete fRoot; 41} 42 43 44status_t 45NetworkSetupProfile::SetTo(const char* path) 46{ 47 SetTo(new BEntry(path)); 48 return B_OK; 49} 50 51 52status_t 53NetworkSetupProfile::SetTo(const entry_ref* ref) 54{ 55 SetTo(new BEntry(ref)); 56 return B_OK; 57} 58 59 60status_t 61NetworkSetupProfile::SetTo(BEntry *entry) 62{ 63 delete fRoot; 64 delete fPath; 65 fRoot = entry; 66 return B_OK; 67} 68 69 70const char* 71NetworkSetupProfile::Name() 72{ 73 if (!fName) { 74 fRoot->GetPath(fPath); 75 fName = fPath->Leaf(); 76 } 77 78 return fName; 79} 80 81 82status_t 83NetworkSetupProfile::SetName(const char* name) 84{ 85 return B_OK; 86} 87 88 89bool 90NetworkSetupProfile::Exists() 91{ 92 return fRoot->Exists(); 93} 94 95 96status_t 97NetworkSetupProfile::Delete() 98{ 99 return B_ERROR; 100} 101 102 103bool 104NetworkSetupProfile::IsDefault() 105{ 106 return fIsDefault; 107} 108 109 110bool 111NetworkSetupProfile::IsCurrent() 112{ 113 return fIsCurrent; 114} 115 116 117status_t 118NetworkSetupProfile::MakeCurrent() 119{ 120 return B_ERROR; 121} 122 123 124// #pragma mark - 125NetworkSetupProfile* 126NetworkSetupProfile::Default() 127{ 128 return NULL; 129} 130 131 132NetworkSetupProfile* 133NetworkSetupProfile::Current() 134{ 135 return NULL; 136} 137