コード例 #1
0
ファイル: wall.cpp プロジェクト: AnnaManchester/cs_130a
void Wall::AddResponseToPost(int post_index, WallPost& post) {
  WallPost* parent = &(wall_posts.get(post_index - 1));
  if (parent->IsResponse()){
      parent = parent->GetParent();
  }
  post.SetParent(parent);
  post.SetDomainName(username);
  parent->AddResponse(&post);
  wall_posts.insert(post_index, post);
}
コード例 #2
0
ファイル: wall.cpp プロジェクト: AnnaManchester/cs_130a
WallPost Wall::DeletePost(int idx_del)
{ 
  WallPost copy = wall_posts.get(idx_del);
  if (copy.IsResponse()) {
    WallPost* parent = copy.GetParent();
    parent->DeleteResponse(copy);
  }
  wall_posts.remove(idx_del);
  return copy;
 }