MCPcopy Create free account
hub / github.com/apache/mesos / parse

Method parse

src/linux/cgroups.cpp:1846–1864  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1844
1845
1846Try<Device> Device::parse(const string& s)
1847{
1848 vector<string> device = strings::tokenize(s, ":");
1849 if (device.size() != 2) {
1850 return Error("Invalid major:minor device number: '" + s + "'");
1851 }
1852
1853 Try<unsigned int> major = numify<unsigned int>(device[0]);
1854 if (major.isError()) {
1855 return Error("Invalid device major number: '" + device[0] + "'");
1856 }
1857
1858 Try<unsigned int> minor = numify<unsigned int>(device[1]);
1859 if (minor.isError()) {
1860 return Error("Invalid device minor number: '" + device[1] + "'");
1861 }
1862
1863 return Device(makedev(major.get(), minor.get()));
1864}
1865
1866
1867static bool isOperation(const string& s)

Callers

nothing calls this directly

Calls 12

tokenizeFunction · 0.85
NoneClass · 0.85
isOperationFunction · 0.85
parseOperationFunction · 0.85
DeviceClass · 0.70
parseFunction · 0.70
errorMethod · 0.65
ErrorFunction · 0.50
sizeMethod · 0.45
isErrorMethod · 0.45
getMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected