blob: 2680e02b3379cc0b6b84194327df2912fb4acd81 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
function r = stringToProtocolVersion(s)
% stringToProtocolVersion Converts a string to a protocol version.
%
% Parameters:
% s (char) - The string to convert.
%
% Returns (Ice.ProtocolVersion) - The converted protocol version.
% Copyright (c) 2003-present ZeroC, Inc. All rights reserved.
tokens = regexp(s, '^([0-9]+)\.([0-9]+)$', 'tokens');
if isempty(tokens)
throw(MException('Ice:ArgumentException', 'expecting a version in X.Y format'));
end
r = Ice.ProtocolVersion(str2num(tokens{1}{1}), str2num(tokens{1}{2}));
end
|