ReactOS  0.4.13-dev-257-gfabbd7c
Bookmark Struct Reference

#include <favorites.h>

Collaboration diagram for Bookmark:

Public Member Functions

 Bookmark ()
 
bool read_url (LPCTSTR path)
 read .URL file More...
 
bool read (const_XMLPos &pos)
 convert XBEL bookmark node More...
 
void write (XMLPos &pos) const
 write XBEL bookmark node More...
 

Public Attributes

String _name
 
String _description
 
String _url
 
String _icon_path
 
int _icon_idx
 
char bookmarkName [16]
 
char name [64]
 
char user [64]
 
char pass [64]
 
char acct [64]
 
char dir [160]
 
char ldir [160]
 
int xferType
 
unsigned int port
 
time_t lastCall
 
int hasSIZE
 
int hasMDTM
 
int hasPASV
 
int isUnix
 
char lastIP [32]
 
char comment [128]
 
int xferMode
 
int hasUTIME
 
int deleted
 

Detailed Description

Definition at line 32 of file favorites.h.

Constructor & Destructor Documentation

◆ Bookmark()

Bookmark::Bookmark ( )
inline

Definition at line 34 of file favorites.h.

34 : _icon_idx(0) {}
int _icon_idx
Definition: favorites.h:40

Member Function Documentation

◆ read()

bool Bookmark::read ( const_XMLPos &  pos)

convert XBEL bookmark node

Definition at line 86 of file favorites.cpp.

87 {
88  _url = pos.get("href").c_str();
89 
90  if (pos.go_down("title")) {
91  _name = pos->get_content();
92  pos.back();
93  }
94 
95  if (pos.go_down("desc")) {
96  _description = pos->get_content();
97  pos.back();
98  }
99 
100  if (pos.go_down("info")) {
101  const_XMLChildrenFilter metadata(pos, "metadata");
102 
103  for(const_XMLChildrenFilter::const_iterator it=metadata.begin(); it!=metadata.end(); ++it) {
104  const XMLNode& node = **it;
105  const_XMLPos sub_pos(&node);
106 
107  if (node.get("owner") == "ros-explorer") {
108  if (sub_pos.go_down("icon")) {
109  _icon_path = sub_pos.get("path").c_str();
110  _icon_idx = XS_toi(sub_pos.get("index"));
111 
112  sub_pos.back(); // </icon>
113  }
114  }
115  }
116 
117  pos.back(); // </metadata>
118  pos.back(); // </info>
119  }
120 
121  return !_url.empty(); // _url is mandatory.
122 }
int _icon_idx
Definition: favorites.h:40
String _url
Definition: favorites.h:38
String _description
Definition: favorites.h:37
String _name
Definition: favorites.h:36
String _icon_path
Definition: favorites.h:39
#define XS_toi
Definition: xmlstorage.h:244
Definition: dlist.c:348

Referenced by BookmarkList::read().

◆ read_url()

bool Bookmark::read_url ( LPCTSTR  path)

read .URL file

Definition at line 54 of file favorites.cpp.

55 {
56  char line[BUFFER_LEN];
57 
58  tifstream in(path);
59 
60  while(in.good()) {
61  in.getline(line, BUFFER_LEN);
62 
63  const char* p = line;
64  while(isspace(*p))
65  ++p;
66 
67  const char* keyword = p;
68  const char* eq = strchr(p, '=');
69 
70  if (eq) {
71  const char* cont = eq + 1;
72  while(isspace(*cont))
73  ++cont;
74 
75  if (!_strnicmp(keyword, "URL", 3))
76  _url = DecodeURLString(cont);
77  else if (!_strnicmp(keyword, "IconFile", 8))
79  }
80  }
81 
82  return true;
83 }
#define isspace(c)
Definition: acclib.h:69
#define eq(received, expected, label, type)
Definition: locale.c:144
_Check_return_ _CRTIMP int __cdecl _strnicmp(_In_reads_or_z_(_MaxCount) const char *_Str1, _In_reads_or_z_(_MaxCount) const char *_Str2, _In_ size_t _MaxCount)
#define BUFFER_LEN
Definition: utility.h:97
String DecodeURLString(const char *s)
Definition: favorites.cpp:34
Definition: parser.c:48
String _url
Definition: favorites.h:38
char line[200]
Definition: main.c:97
GLuint in
Definition: glext.h:9616
Definition: services.c:325
char * strchr(const char *String, int ch)
Definition: utclib.c:501
GLfloat GLfloat p
Definition: glext.h:8902
String _icon_path
Definition: favorites.h:39

Referenced by BookmarkList::import_IE_favorites().

◆ write()

void Bookmark::write ( XMLPos &  pos) const

write XBEL bookmark node

Definition at line 125 of file favorites.cpp.

126 {
127  pos.create("bookmark");
128 
129  pos["href"] = _url.c_str();
130 
131  if (!_name.empty()) {
132  pos.create("title");
133  pos->set_content(_name);
134  pos.back();
135  }
136 
137  if (!_description.empty()) {
138  pos.create("desc");
139  pos->set_content(_description);
140  pos.back();
141  }
142 
143  if (!_icon_path.empty()) {
144  pos.create("info");
145  pos.create("metadata");
146  pos["owner"] = "ros-explorer";
147  pos.create("icon");
148  pos["path"] = _icon_path.c_str();
149  pos["index"].printf(XS_TEXT("%d"), _icon_idx);
150  pos.back(); // </icon>
151  pos.back(); // </metadata>
152  pos.back(); // </info>
153  }
154 
155  pos.back();
156 }
int _icon_idx
Definition: favorites.h:40
String _url
Definition: favorites.h:38
String _description
Definition: favorites.h:37
String _name
Definition: favorites.h:36
#define XS_TEXT(x)
Definition: xmlstorage.h:237
String _icon_path
Definition: favorites.h:39

Referenced by BookmarkList::write().

Member Data Documentation

◆ _description

String Bookmark::_description

Definition at line 37 of file favorites.h.

Referenced by FavoritesMenu::AddEntries(), read(), and write().

◆ _icon_idx

int Bookmark::_icon_idx

Definition at line 40 of file favorites.h.

Referenced by FavoritesMenu::AddEntries(), BookmarkList::fill_tree(), read(), and write().

◆ _icon_path

String Bookmark::_icon_path

Definition at line 39 of file favorites.h.

Referenced by FavoritesMenu::AddEntries(), BookmarkList::fill_tree(), read(), read_url(), and write().

◆ _name

◆ _url

String Bookmark::_url

◆ acct

char Bookmark::acct[64]

Definition at line 14 of file bookmark.h.

Referenced by CurrentURL(), OpenCmd(), and SetStartupURL().

◆ bookmarkName

char Bookmark::bookmarkName[16]

Definition at line 10 of file bookmark.h.

Referenced by BookmarkCmd(), PrintHosts(), and SaveCurrentAsBookmark().

◆ comment

char Bookmark::comment[128]

Definition at line 25 of file bookmark.h.

◆ deleted

int Bookmark::deleted

Definition at line 29 of file bookmark.h.

◆ dir

char Bookmark::dir[160]

Definition at line 15 of file bookmark.h.

Referenced by CurrentURL(), DoOpen(), and SaveUnsavedBookmark().

◆ hasMDTM

int Bookmark::hasMDTM

Definition at line 21 of file bookmark.h.

Referenced by OpenCmd(), and SetStartupURL().

◆ hasPASV

int Bookmark::hasPASV

Definition at line 22 of file bookmark.h.

Referenced by OpenCmd(), and SetStartupURL().

◆ hasSIZE

int Bookmark::hasSIZE

Definition at line 20 of file bookmark.h.

Referenced by OpenCmd(), and SetStartupURL().

◆ hasUTIME

int Bookmark::hasUTIME

Definition at line 27 of file bookmark.h.

Referenced by OpenCmd(), and SetStartupURL().

◆ isUnix

int Bookmark::isUnix

Definition at line 23 of file bookmark.h.

◆ lastCall

time_t Bookmark::lastCall

Definition at line 19 of file bookmark.h.

Referenced by DoOpen().

◆ lastIP

char Bookmark::lastIP[32]

Definition at line 24 of file bookmark.h.

Referenced by DoOpen().

◆ ldir

char Bookmark::ldir[160]

Definition at line 16 of file bookmark.h.

Referenced by DoOpen().

◆ name

char Bookmark::name[64]

Definition at line 11 of file bookmark.h.

Referenced by CurrentURL(), OpenCmd(), and SetStartupURL().

◆ pass

char Bookmark::pass[64]

Definition at line 13 of file bookmark.h.

Referenced by CurrentURL(), OpenCmd(), SaveCurrentAsBookmark(), and SetStartupURL().

◆ port

unsigned int Bookmark::port

Definition at line 18 of file bookmark.h.

Referenced by CurrentURL(), OpenCmd(), and SetStartupURL().

◆ user

char Bookmark::user[64]

Definition at line 12 of file bookmark.h.

Referenced by CurrentURL(), OpenCmd(), and SetStartupURL().

◆ xferMode

int Bookmark::xferMode

Definition at line 26 of file bookmark.h.

◆ xferType

int Bookmark::xferType

Definition at line 17 of file bookmark.h.

Referenced by GetCmd(), PutCmd(), SpoolGetCmd(), SpoolPutCmd(), and TypeCmd().


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