Esempio n. 1
0
bool NProj::setModules(const NOpt<NProj> &opts) { 
	NString tmp;
	NList<NString> validModules;

	validModules.append("NBase");
	validModules.append("NEvents");
	validModules.append("NNetwork");
	validModules.append("NSecurity");
	validModules.append("NXml");
	validModules.append("NDBal");
	validModules.append("NMySQL");

	tmp = opts.getValues().at(0);
	addOpt(&m_modules, tmp);

	for (nuint64 i = 0; i < m_modules.size(); i++) {
		if (!validModules.contains(m_modules.at(i))) {
			NString msg;

			msg = msg + "Module " + m_modules.at(i) + " is not a "
				"valid module";
			throw NException(msg, NException::TOOLS);
		}
	}

	return true;
}
Esempio n. 2
0
NList<NString> NHostAddress::aliases(void) {
	NList<NString> ret;
	NString tmp;
	
	while (*m_host.h_aliases) { 
		tmp = *m_host.h_aliases;
		ret.append(tmp);
		m_host.h_aliases++;
	}
	
	
	return ret;
}
Esempio n. 3
0
NList<nuint32> NHostAddress::addresses(void) {
	NList<nuint32> ret;
	nuint32 tmp = 0;
	
	for (int i = 0; m_host.h_addr_list[i]; i++) {
		tmp |= (unsigned char) m_host.h_addr_list[i][3];
		tmp <<= 8;
		tmp |= (unsigned char) m_host.h_addr_list[i][2];
		tmp <<= 8;
		tmp |= (unsigned char) m_host.h_addr_list[i][1];
		tmp <<= 8;
		tmp |= (unsigned char) m_host.h_addr_list[i][0];
		ret.append(tmp);
		
	}
	
	return ret;

}