在c ++中逐行读取文件(将代码从Python转换为C ++)

我必须将代码从Python转换为C ++,但是我找不到找到此部分的方法:

with open(files.square, "r") as f: # files.square is a txt file
lines = f.readlines()
with open(files.bs, "a") as f:     # files.bs is a txt file
    for i, line in enumerate(lines):
        if line == "LINE\n": txt_line(i, line, lines)
        if line == "ARC\n": txt_arc(i, line, lines)

基本上,我想翻译所有代码,但是我不知道如何翻译。