Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
aeb696a9
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
接近 2 年 前同步成功
通知
1
Star
18
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Harfbuzz
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
“7712fd58c256935fca7555543b0211d612eb022c”上不存在“Dockerfile”
提交
aeb696a9
编写于
12月 21, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[iter] Rename
上级
8001e00a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
22 addition
and
22 deletion
+22
-22
src/hb-iter.hh
src/hb-iter.hh
+22
-22
未找到文件。
src/hb-iter.hh
浏览文件 @
aeb696a9
...
@@ -44,31 +44,31 @@
...
@@ -44,31 +44,31 @@
template
<
typename
Iter
,
typename
Item
=
typename
Iter
::
__item_type__
>
template
<
typename
Iter
,
typename
Item
=
typename
Iter
::
__item_type__
>
struct
hb_iter_t
struct
hb_iter_t
{
{
typedef
Iter
type
_t
;
typedef
Iter
iter
_t
;
typedef
Item
item_t
ype_t
;
typedef
Item
item_t
;
/* https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern */
/* https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern */
const
type_t
*
thiz
()
const
{
return
static_cast
<
const
type
_t
*>
(
this
);
}
const
iter_t
*
thiz
()
const
{
return
static_cast
<
const
iter
_t
*>
(
this
);
}
type_t
*
thiz
()
{
return
static_cast
<
type
_t
*>
(
this
);
}
iter_t
*
thiz
()
{
return
static_cast
<
iter
_t
*>
(
this
);
}
/* Operators. */
/* Operators. */
operator
type
_t
()
{
return
iter
();
}
operator
iter
_t
()
{
return
iter
();
}
explicit_operator
bool
()
const
{
return
more
();
}
explicit_operator
bool
()
const
{
return
more
();
}
item_t
ype_t
&
operator
*
()
{
return
item
();
}
item_t
&
operator
*
()
{
return
item
();
}
item_t
ype_t
&
operator
[]
(
unsigned
i
)
{
return
item
(
i
);
}
item_t
&
operator
[]
(
unsigned
i
)
{
return
item
(
i
);
}
type
_t
&
operator
+=
(
unsigned
count
)
{
forward
(
count
);
return
*
thiz
();
}
iter
_t
&
operator
+=
(
unsigned
count
)
{
forward
(
count
);
return
*
thiz
();
}
type
_t
&
operator
++
()
{
next
();
return
*
thiz
();
}
iter
_t
&
operator
++
()
{
next
();
return
*
thiz
();
}
type
_t
&
operator
-=
(
unsigned
count
)
{
rewind
(
count
);
return
*
thiz
();
}
iter
_t
&
operator
-=
(
unsigned
count
)
{
rewind
(
count
);
return
*
thiz
();
}
type
_t
&
operator
--
()
{
prev
();
return
*
thiz
();
}
iter
_t
&
operator
--
()
{
prev
();
return
*
thiz
();
}
type_t
operator
+
(
unsigned
count
)
{
type
_t
c
(
*
thiz
());
c
+=
count
;
return
c
;
}
iter_t
operator
+
(
unsigned
count
)
{
iter
_t
c
(
*
thiz
());
c
+=
count
;
return
c
;
}
type_t
operator
++
(
int
)
{
type
_t
c
(
*
thiz
());
++*
thiz
();
return
c
;
}
iter_t
operator
++
(
int
)
{
iter
_t
c
(
*
thiz
());
++*
thiz
();
return
c
;
}
type_t
operator
-
(
unsigned
count
)
{
type
_t
c
(
*
thiz
());
c
-=
count
;
return
c
;
}
iter_t
operator
-
(
unsigned
count
)
{
iter
_t
c
(
*
thiz
());
c
-=
count
;
return
c
;
}
type_t
operator
--
(
int
)
{
type
_t
c
(
*
thiz
());
--*
thiz
();
return
c
;
}
iter_t
operator
--
(
int
)
{
iter
_t
c
(
*
thiz
());
--*
thiz
();
return
c
;
}
/* Methods. */
/* Methods. */
type
_t
iter
()
const
{
return
*
thiz
();
}
iter
_t
iter
()
const
{
return
*
thiz
();
}
item_t
ype_t
&
item
()
const
{
return
thiz
()
->
__item__
();
}
item_t
&
item
()
const
{
return
thiz
()
->
__item__
();
}
item_t
ype_t
&
item_at
(
unsigned
i
)
const
{
return
thiz
()
->
__item_at__
(
i
);
}
item_t
&
item_at
(
unsigned
i
)
const
{
return
thiz
()
->
__item_at__
(
i
);
}
bool
more
()
const
{
return
thiz
()
->
__more__
();
}
bool
more
()
const
{
return
thiz
()
->
__more__
();
}
void
next
()
{
thiz
()
->
__next__
();
}
void
next
()
{
thiz
()
->
__next__
();
}
void
forward
(
unsigned
n
)
{
thiz
()
->
__forward__
(
n
);
}
void
forward
(
unsigned
n
)
{
thiz
()
->
__forward__
(
n
);
}
...
@@ -81,12 +81,12 @@ struct hb_iter_t
...
@@ -81,12 +81,12 @@ struct hb_iter_t
*/
*/
/* Access: Implement __item__(), or __item_at__() if random-access. */
/* Access: Implement __item__(), or __item_at__() if random-access. */
item_t
ype_t
&
__item__
()
const
{
return
thiz
()
->
item_at
(
0
);
}
item_t
&
__item__
()
const
{
return
thiz
()
->
item_at
(
0
);
}
item_t
ype_t
&
__item_at__
(
unsigned
i
)
const
{
return
*
(
thiz
()
+
i
);
}
item_t
&
__item_at__
(
unsigned
i
)
const
{
return
*
(
thiz
()
+
i
);
}
/* Termination: Implement __more__() or __end__(). */
/* Termination: Implement __more__() or __end__(). */
bool
__more__
()
const
{
return
item
()
!=
thiz
()
->
__end__
();
}
bool
__more__
()
const
{
return
item
()
!=
thiz
()
->
__end__
();
}
const
item_t
ype_t
&
__end__
()
const
{
return
type
_t
::
__sentinel__
;
}
const
item_t
&
__end__
()
const
{
return
iter
_t
::
__sentinel__
;
}
/* Advancing: Implement __next__(), or __forward__() if random-access. */
/* Advancing: Implement __next__(), or __forward__() if random-access. */
void
__next__
()
{
thiz
()
->
forward
(
1
);
}
void
__next__
()
{
thiz
()
->
forward
(
1
);
}
...
@@ -98,7 +98,7 @@ struct hb_iter_t
...
@@ -98,7 +98,7 @@ struct hb_iter_t
/* Population: Implement __len__() if known. */
/* Population: Implement __len__() if known. */
unsigned
__len__
()
const
unsigned
__len__
()
const
{
type
_t
c
(
*
thiz
());
unsigned
l
=
0
;
while
(
c
)
{
c
++
;
l
++
;
};
return
l
;
}
{
iter
_t
c
(
*
thiz
());
unsigned
l
=
0
;
while
(
c
)
{
c
++
;
l
++
;
};
return
l
;
}
};
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录